Explorar el Código

Fix hamming test for different strand lengths

Now throws an IllegalArgumentException if the strands are different
lengths.
Christian Wilkie hace 11 años
padre
commit
567d70408d
Se han modificado 1 ficheros con 6 adiciones y 6 borrados
  1. 6
    6
      hamming/src/test/java/HammingTest.java

+ 6
- 6
hamming/src/test/java/HammingTest.java Ver fichero

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