Przeglądaj źródła

Fix hamming test for different strand lengths

Now throws an IllegalArgumentException if the strands are different
lengths.
Christian Wilkie 11 lat temu
rodzic
commit
567d70408d
1 zmienionych plików z 6 dodań i 6 usunięć
  1. 6
    6
      hamming/src/test/java/HammingTest.java

+ 6
- 6
hamming/src/test/java/HammingTest.java Wyświetl plik

30
         assertThat(Hamming.compute("GGACG", "GGTCG"), is(1));
30
         assertThat(Hamming.compute("GGACG", "GGTCG"), is(1));
31
     }
31
     }
32
 
32
 
33
-    @Test
34
-    public void testIgnoresExtraLengthOnFirstStrandWhenLonger() {
35
-        assertThat(Hamming.compute("AAAG", "AAA"), is(0));
33
+    @Test(expected = IllegalArgumentException.class)
34
+    public void testValidatesFirstStrandNotLonger() {
35
+        Hamming.compute("AAAG", "AAA");
36
     }
36
     }
37
 
37
 
38
-    @Test
39
-    public void testIgnoresExtraLengthOnOtherStrandWhenLonger() {
40
-        assertThat(Hamming.compute("AAA", "AAAG"), is(0));
38
+    @Test(expected = IllegalArgumentException.class)
39
+    public void testValidatesOtherStrandNotLonger() {
40
+        Hamming.compute("AAA", "AAAG");
41
     }
41
     }
42
 
42
 
43
     @Test
43
     @Test