|
|
@@ -2,9 +2,18 @@ import org.junit.Assert;
|
|
2
|
2
|
import org.junit.Before;
|
|
3
|
3
|
import org.junit.Ignore;
|
|
4
|
4
|
import org.junit.Test;
|
|
|
5
|
+import org.junit.rules.ExpectedException;
|
|
|
6
|
+import org.junit.Rule;
|
|
5
|
7
|
|
|
6
|
8
|
public class RnaTranscriptionTest {
|
|
7
|
9
|
|
|
|
10
|
+ /*
|
|
|
11
|
+ version: 2.0.0
|
|
|
12
|
+ */
|
|
|
13
|
+
|
|
|
14
|
+ @Rule
|
|
|
15
|
+ public ExpectedException thrown = ExpectedException.none();
|
|
|
16
|
+
|
|
8
|
17
|
private RnaTranscription rnaTranscription;
|
|
9
|
18
|
|
|
10
|
19
|
@Before
|
|
|
@@ -46,4 +55,28 @@ public class RnaTranscriptionTest {
|
|
46
|
55
|
public void testRnaTranscription() {
|
|
47
|
56
|
Assert.assertEquals("UGCACCAGAAUU", rnaTranscription.transcribe("ACGTGGTCTTAA"));
|
|
48
|
57
|
}
|
|
|
58
|
+
|
|
|
59
|
+ @Ignore("Remove to run test")
|
|
|
60
|
+ @Test
|
|
|
61
|
+ public void testRnaTranscriptionOfRnaThrowsAnError() {
|
|
|
62
|
+ thrown.expect(IllegalArgumentException.class);
|
|
|
63
|
+ thrown.expectMessage("Invalid input");
|
|
|
64
|
+ rnaTranscription.transcribe("U");
|
|
|
65
|
+ }
|
|
|
66
|
+
|
|
|
67
|
+ @Ignore("Remove to run test")
|
|
|
68
|
+ @Test
|
|
|
69
|
+ public void testRnaTranscriptionOfInvalidInputThrowsAnError() {
|
|
|
70
|
+ thrown.expect(IllegalArgumentException.class);
|
|
|
71
|
+ thrown.expectMessage("Invalid input");
|
|
|
72
|
+ rnaTranscription.transcribe("BFV");
|
|
|
73
|
+ }
|
|
|
74
|
+
|
|
|
75
|
+ @Ignore("Remove to run test")
|
|
|
76
|
+ @Test
|
|
|
77
|
+ public void testRnaTranscriptionOfPartiallyInvalidInput() {
|
|
|
78
|
+ thrown.expect(IllegalArgumentException.class);
|
|
|
79
|
+ thrown.expectMessage("Invalid input");
|
|
|
80
|
+ rnaTranscription.transcribe("GCVV");
|
|
|
81
|
+ }
|
|
49
|
82
|
}
|