JAL-2602 unit test added
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 30 Jun 2017 14:06:50 +0000 (15:06 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 30 Jun 2017 14:06:50 +0000 (15:06 +0100)
test/jalview/gui/AlignViewportTest.java

index 4660842..346d74d 100644 (file)
@@ -450,6 +450,23 @@ public class AlignViewportTest
     }
     ;
     Assert.assertEquals(c, 1, "Expected to find one occupancy row.");
+  }
 
+  @Test(groups = { "Functional" })
+  public void testGetConsensusSeq()
+  {
+    /*
+     * A-C
+     * A-C
+     * A-D
+     * --D
+     * consensus expected to be A-C
+     */
+    String fasta = ">s1\nA-C\n>s2\nA-C\n>s3\nA-D\n>s4\n--D\n";
+    AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(fasta,
+            DataSourceType.PASTE);
+    AlignViewport testme = af.getViewport();
+    SequenceI cons = testme.getConsensusSeq();
+    assertEquals("A-C", cons.getSequenceAsString());
   }
 }