|
|
@@ -3,10 +3,15 @@ import static org.junit.Assert.*;
|
|
3
|
3
|
|
|
4
|
4
|
import org.junit.Test;
|
|
5
|
5
|
import org.junit.Ignore;
|
|
|
6
|
+import org.junit.Rule;
|
|
|
7
|
+import org.junit.rules.ExpectedException;
|
|
6
|
8
|
|
|
7
|
9
|
public class HammingTest {
|
|
8
|
10
|
|
|
9
|
11
|
|
|
|
12
|
+ @Rule
|
|
|
13
|
+ public ExpectedException thrown = ExpectedException.none();
|
|
|
14
|
+
|
|
10
|
15
|
@Test
|
|
11
|
16
|
public void testNoDifferenceBetweenIdenticalStrands() {
|
|
12
|
17
|
assertThat(Hamming.compute("A", "A"), is(0));
|
|
|
@@ -37,14 +42,16 @@ public class HammingTest {
|
|
37
|
42
|
}
|
|
38
|
43
|
|
|
39
|
44
|
@Ignore
|
|
40
|
|
- @Test(expected = IllegalArgumentException.class)
|
|
|
45
|
+ @Test
|
|
41
|
46
|
public void testValidatesFirstStrandNotLonger() {
|
|
42
|
|
- Hamming.compute("AAAG", "AAA");
|
|
|
47
|
+ thrown.expect(IllegalArgumentException.class);
|
|
|
48
|
+ Hamming.compute("AAAG", "AAA");
|
|
43
|
49
|
}
|
|
44
|
50
|
|
|
45
|
51
|
@Ignore
|
|
46
|
|
- @Test(expected = IllegalArgumentException.class)
|
|
|
52
|
+ @Test
|
|
47
|
53
|
public void testValidatesOtherStrandNotLonger() {
|
|
|
54
|
+ thrown.expect(IllegalArgumentException.class);
|
|
48
|
55
|
Hamming.compute("AAA", "AAAG");
|
|
49
|
56
|
}
|
|
50
|
57
|
|