|
|
@@ -1,5 +1,7 @@
|
|
1
|
1
|
import org.junit.Ignore;
|
|
2
|
2
|
import org.junit.Test;
|
|
|
3
|
+import org.junit.Rule;
|
|
|
4
|
+import org.junit.rules.ExpectedException;
|
|
3
|
5
|
|
|
4
|
6
|
import java.util.Map;
|
|
5
|
7
|
|
|
|
@@ -8,6 +10,9 @@ import static org.junit.Assert.*;
|
|
8
|
10
|
|
|
9
|
11
|
public class NucleotideTest {
|
|
10
|
12
|
|
|
|
13
|
+ @Rule
|
|
|
14
|
+ public ExpectedException thrown = ExpectedException.none();
|
|
|
15
|
+
|
|
11
|
16
|
@Test
|
|
12
|
17
|
public void testEmptyDnaStringHasNoAdenosine() {
|
|
13
|
18
|
DNA dna = new DNA("");
|
|
|
@@ -80,8 +85,9 @@ public class NucleotideTest {
|
|
80
|
85
|
}
|
|
81
|
86
|
|
|
82
|
87
|
@Ignore
|
|
83
|
|
- @Test(expected = IllegalArgumentException.class)
|
|
|
88
|
+ @Test
|
|
84
|
89
|
public void testValidatesNucleotides() {
|
|
|
90
|
+ thrown.expect(IllegalArgumentException.class);
|
|
85
|
91
|
DNA dna = new DNA("GACT");
|
|
86
|
92
|
dna.count('X');
|
|
87
|
93
|
}
|