JAL-2624 additional tests for FeatureColour.getColour(),
[jalview.git] / test / jalview / schemes / FeatureColourTest.java
index 03f7efa..7a72c15 100644 (file)
@@ -128,17 +128,28 @@ public class FeatureColourTest
             150f);
     SequenceFeature sf = new SequenceFeature("type", "desc", 0, 20, 70f,
             null);
+
+    /*
+     * feature with score of Float.NaN is always assigned minimum colour
+     */
+    SequenceFeature sf2 = new SequenceFeature("type", "desc", 0, 20,
+            Float.NaN, null);
+
     fc.setThreshold(100f); // ignore for now
     assertEquals(new Color(204, 204, 204), fc.getColor(sf));
+    assertEquals(Color.white, fc.getColor(sf2));
 
     fc.setAboveThreshold(true); // feature lies below threshold
     assertNull(fc.getColor(sf));
+    assertEquals(Color.white, fc.getColor(sf2));
 
     fc.setBelowThreshold(true);
     fc.setThreshold(70f);
     assertNull(fc.getColor(sf)); // feature score == threshold - hidden
+    assertEquals(Color.white, fc.getColor(sf2));
     fc.setThreshold(69f);
     assertNull(fc.getColor(sf)); // feature score > threshold - hidden
+    assertEquals(Color.white, fc.getColor(sf2));
   }
 
   /**