Просмотр исходного кода

Merge pull request #521 from Smarticles101/rna-transcription-rename

rna-transcription: rename "ofDna" with "transcribe"
FridaTveit 9 лет назад
Родитель
Сommit
5df2e8b42b

+ 2
- 2
exercises/rna-transcription/src/example/java/RnaTranscription.java Просмотреть файл

1
 public class RnaTranscription {
1
 public class RnaTranscription {
2
 
2
 
3
-    public String ofDna(String strand) {
3
+    public String transcribe(String dnaStrand) {
4
         StringBuilder sb = new StringBuilder();
4
         StringBuilder sb = new StringBuilder();
5
-        for (char c : strand.toCharArray()) {
5
+        for (char c : dnaStrand.toCharArray()) {
6
             switch (c) {
6
             switch (c) {
7
                 case 'A':
7
                 case 'A':
8
                     sb.append('U');
8
                     sb.append('U');

+ 1
- 1
exercises/rna-transcription/src/main/java/RnaTranscription.java Просмотреть файл

1
 public class RnaTranscription {
1
 public class RnaTranscription {
2
-    public String ofDna(String dnaString) {
2
+    public String transcribe(String dnaStrand) {
3
         throw new UnsupportedOperationException("Method has not been implemented yet.");
3
         throw new UnsupportedOperationException("Method has not been implemented yet.");
4
     }
4
     }
5
 }
5
 }

+ 6
- 6
exercises/rna-transcription/src/test/java/RnaTranscriptionTest.java Просмотреть файл

14
 
14
 
15
     @Test
15
     @Test
16
     public void testRnaTranscriptionOfEmptyDnaIsEmptyRna() {
16
     public void testRnaTranscriptionOfEmptyDnaIsEmptyRna() {
17
-        Assert.assertEquals("", rnaTranscription.ofDna(""));
17
+        Assert.assertEquals("", rnaTranscription.transcribe(""));
18
     }
18
     }
19
 
19
 
20
     @Ignore("Remove to run test")
20
     @Ignore("Remove to run test")
21
     @Test
21
     @Test
22
     public void testRnaTranscriptionOfCytosineIsGuanine() {
22
     public void testRnaTranscriptionOfCytosineIsGuanine() {
23
-        Assert.assertEquals("G", rnaTranscription.ofDna("C"));
23
+        Assert.assertEquals("G", rnaTranscription.transcribe("C"));
24
     }
24
     }
25
 
25
 
26
     @Ignore("Remove to run test")
26
     @Ignore("Remove to run test")
27
     @Test
27
     @Test
28
     public void testRnaTranscriptionOfGuanineIsCytosine() {
28
     public void testRnaTranscriptionOfGuanineIsCytosine() {
29
-        Assert.assertEquals("C", rnaTranscription.ofDna("G"));
29
+        Assert.assertEquals("C", rnaTranscription.transcribe("G"));
30
     }
30
     }
31
 
31
 
32
     @Ignore("Remove to run test")
32
     @Ignore("Remove to run test")
33
     @Test
33
     @Test
34
     public void testRnaTranscriptionOfThymineIsAdenine() {
34
     public void testRnaTranscriptionOfThymineIsAdenine() {
35
-        Assert.assertEquals("A", rnaTranscription.ofDna("T"));
35
+        Assert.assertEquals("A", rnaTranscription.transcribe("T"));
36
     }
36
     }
37
 
37
 
38
     @Ignore("Remove to run test")
38
     @Ignore("Remove to run test")
39
     @Test
39
     @Test
40
     public void testRnaTranscriptionOfAdenineIsUracil() {
40
     public void testRnaTranscriptionOfAdenineIsUracil() {
41
-        Assert.assertEquals("U", rnaTranscription.ofDna("A"));
41
+        Assert.assertEquals("U", rnaTranscription.transcribe("A"));
42
     }
42
     }
43
 
43
 
44
     @Ignore("Remove to run test")
44
     @Ignore("Remove to run test")
45
     @Test
45
     @Test
46
     public void testRnaTranscription() {
46
     public void testRnaTranscription() {
47
-        Assert.assertEquals("UGCACCAGAAUU", rnaTranscription.ofDna("ACGTGGTCTTAA"));
47
+        Assert.assertEquals("UGCACCAGAAUU", rnaTranscription.transcribe("ACGTGGTCTTAA"));
48
     }
48
     }
49
 }
49
 }