1 |
|
package jalview.schemes; |
2 |
|
|
3 |
|
import static org.testng.Assert.assertEquals; |
4 |
|
|
5 |
|
import java.awt.Color; |
6 |
|
|
7 |
|
import org.testng.annotations.Test; |
8 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 1 |
Complexity Density: 0.12 |
|
9 |
|
public class BuriedColourSchemeTest |
10 |
|
{ |
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 1 |
Complexity Density: 0.12 |
1PASS
|
|
17 |
1 |
@Test(groups = "Functional")... |
18 |
|
public void testFindColour() |
19 |
|
{ |
20 |
1 |
ScoreColourScheme scheme = new BuriedColourScheme(); |
21 |
|
|
22 |
1 |
float min = 0.05f; |
23 |
1 |
float max = 4.6f; |
24 |
1 |
float a = (1.7f - min) / (max - min); |
25 |
1 |
assertEquals(scheme.findColour('A', 0, null), new Color(0, 1 - a, a)); |
26 |
|
|
27 |
1 |
float d = (0.4f - min) / (max - min); |
28 |
1 |
assertEquals(scheme.findColour('D', 0, null), new Color(0, 1 - d, d)); |
29 |
|
|
30 |
1 |
assertEquals(scheme.findColour('-', 0, null), Color.WHITE); |
31 |
|
} |
32 |
|
|
33 |
|
} |