1- import org .junit .Assert ;
21import org .junit .Before ;
32import org .junit .Ignore ;
3+ import org .junit .Rule ;
44import org .junit .Test ;
55import org .junit .rules .ExpectedException ;
6- import org .junit .Rule ;
76
8- public class RnaTranscriptionTest {
7+ import static org . junit . Assert . assertEquals ;
98
10- /*
11- version: 2.0.0
12- */
9+ /*
10+ * version: 1.0.1
11+ */
12+ public class RnaTranscriptionTest {
1313
1414 @ Rule
15- public ExpectedException thrown = ExpectedException .none ();
15+ public ExpectedException expectedException = ExpectedException .none ();
1616
1717 private RnaTranscription rnaTranscription ;
1818
@@ -21,62 +21,57 @@ public void setUp() {
2121 rnaTranscription = new RnaTranscription ();
2222 }
2323
24- @ Test
25- public void testRnaTranscriptionOfEmptyDnaIsEmptyRna () {
26- Assert .assertEquals ("" , rnaTranscription .transcribe ("" ));
27- }
28-
29- @ Ignore ("Remove to run test" )
3024 @ Test
3125 public void testRnaTranscriptionOfCytosineIsGuanine () {
32- Assert . assertEquals ("G" , rnaTranscription .transcribe ("C" ));
26+ assertEquals ("G" , rnaTranscription .transcribe ("C" ));
3327 }
3428
3529 @ Ignore ("Remove to run test" )
3630 @ Test
3731 public void testRnaTranscriptionOfGuanineIsCytosine () {
38- Assert . assertEquals ("C" , rnaTranscription .transcribe ("G" ));
32+ assertEquals ("C" , rnaTranscription .transcribe ("G" ));
3933 }
4034
4135 @ Ignore ("Remove to run test" )
4236 @ Test
4337 public void testRnaTranscriptionOfThymineIsAdenine () {
44- Assert . assertEquals ("A" , rnaTranscription .transcribe ("T" ));
38+ assertEquals ("A" , rnaTranscription .transcribe ("T" ));
4539 }
4640
4741 @ Ignore ("Remove to run test" )
4842 @ Test
4943 public void testRnaTranscriptionOfAdenineIsUracil () {
50- Assert . assertEquals ("U" , rnaTranscription .transcribe ("A" ));
44+ assertEquals ("U" , rnaTranscription .transcribe ("A" ));
5145 }
5246
5347 @ Ignore ("Remove to run test" )
5448 @ Test
5549 public void testRnaTranscription () {
56- Assert . assertEquals ("UGCACCAGAAUU" , rnaTranscription .transcribe ("ACGTGGTCTTAA" ));
50+ assertEquals ("UGCACCAGAAUU" , rnaTranscription .transcribe ("ACGTGGTCTTAA" ));
5751 }
5852
5953 @ Ignore ("Remove to run test" )
6054 @ Test
6155 public void testRnaTranscriptionOfRnaThrowsAnError () {
62- thrown .expect (IllegalArgumentException .class );
63- thrown .expectMessage ("Invalid input" );
56+ expectedException .expect (IllegalArgumentException .class );
57+ expectedException .expectMessage ("Invalid input" );
6458 rnaTranscription .transcribe ("U" );
6559 }
6660
6761 @ Ignore ("Remove to run test" )
6862 @ Test
6963 public void testRnaTranscriptionOfInvalidInputThrowsAnError () {
70- thrown .expect (IllegalArgumentException .class );
71- thrown .expectMessage ("Invalid input" );
72- rnaTranscription .transcribe ("BFV " );
64+ expectedException .expect (IllegalArgumentException .class );
65+ expectedException .expectMessage ("Invalid input" );
66+ rnaTranscription .transcribe ("XXX " );
7367 }
7468
7569 @ Ignore ("Remove to run test" )
7670 @ Test
7771 public void testRnaTranscriptionOfPartiallyInvalidInput () {
78- thrown .expect (IllegalArgumentException .class );
79- thrown .expectMessage ("Invalid input" );
80- rnaTranscription .transcribe ("GCVV " );
72+ expectedException .expect (IllegalArgumentException .class );
73+ expectedException .expectMessage ("Invalid input" );
74+ rnaTranscription .transcribe ("ACGTXXXCTTAA " );
8175 }
76+
8277}
0 commit comments