+
+ @Test(groups = { "Functional" })
+ public void testGetColor_colourByLabel_withThreshold()
+ {
+ FeatureColour fc = new FeatureColour();
+ fc.setColourByLabel(true);
+ SequenceFeature sf = new SequenceFeature("type", "desc", 0, 20, 1f,
+ null);
+ fc.setThreshold(0);
+ Color expected = ColorUtils.createColourFromName("desc");
+ assertEquals(expected, fc.getColor(sf));
+
+ // score (1f) is above threshold
+ fc.setAboveThreshold(true);
+ assertEquals(expected, fc.getColor(sf));
+
+ // score is not above threshold
+ fc.setThreshold(2f);
+ assertNull(fc.getColor(sf));
+
+ // score is not below threshold
+ fc.setThreshold(0f);
+ fc.setBelowThreshold(true);
+ assertNull(fc.getColor(sf));
+
+ // score is below threshold
+ fc.setThreshold(3f);
+ assertEquals(expected, fc.getColor(sf));
+ }