Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rna-transcription: rename "ofDna" with "transcribe" #521

Merged
merged 3 commits into from
May 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
public class RnaTranscription {

public String ofDna(String strand) {
public String transcribe(String dnaStrand) {
StringBuilder sb = new StringBuilder();
for (char c : strand.toCharArray()) {
for (char c : dnaStrand.toCharArray()) {
switch (c) {
case 'A':
sb.append('U');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
public class RnaTranscription {
public String ofDna(String dnaString) {
public String transcribe(String dnaStrand) {
throw new UnsupportedOperationException("Method has not been implemented yet.");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,36 @@ public void setUp() {

@Test
public void testRnaTranscriptionOfEmptyDnaIsEmptyRna() {
Assert.assertEquals("", rnaTranscription.ofDna(""));
Assert.assertEquals("", rnaTranscription.transcribe(""));
}

@Ignore("Remove to run test")
@Test
public void testRnaTranscriptionOfCytosineIsGuanine() {
Assert.assertEquals("G", rnaTranscription.ofDna("C"));
Assert.assertEquals("G", rnaTranscription.transcribe("C"));
}

@Ignore("Remove to run test")
@Test
public void testRnaTranscriptionOfGuanineIsCytosine() {
Assert.assertEquals("C", rnaTranscription.ofDna("G"));
Assert.assertEquals("C", rnaTranscription.transcribe("G"));
}

@Ignore("Remove to run test")
@Test
public void testRnaTranscriptionOfThymineIsAdenine() {
Assert.assertEquals("A", rnaTranscription.ofDna("T"));
Assert.assertEquals("A", rnaTranscription.transcribe("T"));
}

@Ignore("Remove to run test")
@Test
public void testRnaTranscriptionOfAdenineIsUracil() {
Assert.assertEquals("U", rnaTranscription.ofDna("A"));
Assert.assertEquals("U", rnaTranscription.transcribe("A"));
}

@Ignore("Remove to run test")
@Test
public void testRnaTranscription() {
Assert.assertEquals("UGCACCAGAAUU", rnaTranscription.ofDna("ACGTGGTCTTAA"));
Assert.assertEquals("UGCACCAGAAUU", rnaTranscription.transcribe("ACGTGGTCTTAA"));
}
}