Skip to content

Commit

Permalink
Merge pull request #334 from FridaTveit/RnaTranscriptionChangeToObject
Browse files Browse the repository at this point in the history
rna-transcription: make object-based and add starter implementation
  • Loading branch information
stkent authored Mar 6, 2017
2 parents d297212 + bc1ce4e commit bbfaa4c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
public class RnaTranscription {

public static String ofDna(String strand) {
public String ofDna(String strand) {
StringBuilder sb = new StringBuilder();
for (char c : strand.toCharArray()) {
switch (c) {
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
public class RnaTranscription {
public String ofDna(String dnaString) {
throw new UnsupportedOperationException("Method has not been implemented yet.");
}
}
Original file line number Diff line number Diff line change
@@ -1,42 +1,49 @@
import org.junit.Assert;
import org.junit.Test;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

public class RnaTranscriptionTest {

private RnaTranscription rnaTranscription;

@Before
public void setUp() {
rnaTranscription = new RnaTranscription();
}

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

@Ignore
@Test
public void testRnaTranscriptionOfCytosineIsGuanine() {
Assert.assertEquals("G", RnaTranscription.ofDna("C"));
Assert.assertEquals("G", rnaTranscription.ofDna("C"));
}

@Ignore
@Test
public void testRnaTranscriptionOfGuanineIsCytosine() {
Assert.assertEquals("C", RnaTranscription.ofDna("G"));
Assert.assertEquals("C", rnaTranscription.ofDna("G"));
}

@Ignore
@Test
public void testRnaTranscriptionOfThymineIsAdenine() {
Assert.assertEquals("A", RnaTranscription.ofDna("T"));
Assert.assertEquals("A", rnaTranscription.ofDna("T"));
}

@Ignore
@Test
public void testRnaTranscriptionOfAdenineIsUracil() {
Assert.assertEquals("U", RnaTranscription.ofDna("A"));
Assert.assertEquals("U", rnaTranscription.ofDna("A"));
}

@Ignore
@Test
public void testRnaTranscription() {
Assert.assertEquals("UGCACCAGAAUU", RnaTranscription.ofDna("ACGTGGTCTTAA"));
Assert.assertEquals("UGCACCAGAAUU", rnaTranscription.ofDna("ACGTGGTCTTAA"));
}
}

0 comments on commit bbfaa4c

Please sign in to comment.