JAL-2512 And corresponding test bug/JAL-2512
authorkiramt <k.mourao@dundee.ac.uk>
Mon, 8 May 2017 08:06:22 +0000 (09:06 +0100)
committerkiramt <k.mourao@dundee.ac.uk>
Mon, 8 May 2017 08:06:22 +0000 (09:06 +0100)
test/jalview/gui/SequenceRendererTest.java

index 29a9a52..c80b830 100644 (file)
@@ -58,6 +58,24 @@ public class SequenceRendererTest
     assertEquals(Color.magenta, sr.getResidueBoxColour(seq, 5)); // G
     assertEquals(Color.orange, sr.getResidueBoxColour(seq, 12)); // F
   }
+
+  @Test(groups = { "Functional" })
+  public void testGetResidueBoxColour_none()
+  {
+    SequenceI seq = new Sequence("name", "MA--TVLGSPRAPAFF");
+    AlignmentI al = new Alignment(new SequenceI[] { seq });
+    final AlignViewport av = new AlignViewport(al);
+    SequenceRenderer sr = new SequenceRenderer(av);
+
+    assertEquals(Color.white, sr.getResidueBoxColour(seq, 0));
+    assertEquals(Color.white, sr.getResidueBoxColour(seq, 2));
+
+    // set for overview
+    sr.forOverview = true;
+    assertEquals(Color.lightGray, sr.getResidueBoxColour(seq, 0));
+    assertEquals(Color.white, sr.getResidueBoxColour(seq, 2));
+  }
+
   // TODO more tests for getResidueBoxColour covering groups, feature rendering,
   // gaps, overview...