|
| 1 | +import org.junit.Before; |
| 2 | +import org.junit.Ignore; |
| 3 | +import org.junit.Test; |
| 4 | + |
| 5 | +import java.util.Arrays; |
| 6 | +import java.util.List; |
| 7 | + |
| 8 | +import static org.junit.Assert.assertEquals; |
| 9 | + |
| 10 | +public class ProteinTranslatorTest { |
| 11 | + |
| 12 | + private ProteinTranslator proteinTranslator; |
| 13 | + |
| 14 | + @Before |
| 15 | + public void setUp() { |
| 16 | + proteinTranslator = new ProteinTranslator(); |
| 17 | + } |
| 18 | + |
| 19 | + @Test |
| 20 | + public void testMethionineRnaSequence() { |
| 21 | + List<String> expected = Arrays.asList("Methionine"); |
| 22 | + assertEquals(expected, proteinTranslator.translate("AUG")); |
| 23 | + } |
| 24 | + |
| 25 | + @Ignore("Remove to run test") |
| 26 | + @Test |
| 27 | + public void testPhenylalanineRnaSequence1() { |
| 28 | + List<String> expected = Arrays.asList("Phenylalanine"); |
| 29 | + assertEquals(expected, proteinTranslator.translate("UUU")); |
| 30 | + } |
| 31 | + |
| 32 | + @Ignore("Remove to run test") |
| 33 | + @Test |
| 34 | + public void testPhenylalanineRnaSequence2() { |
| 35 | + List<String> expected = Arrays.asList("Phenylalanine"); |
| 36 | + assertEquals(expected, proteinTranslator.translate("UUC")); |
| 37 | + } |
| 38 | + |
| 39 | + @Ignore("Remove to run test") |
| 40 | + @Test |
| 41 | + public void testLeucineRnaSequence1() { |
| 42 | + List<String> expected = Arrays.asList("Leucine"); |
| 43 | + assertEquals(expected, proteinTranslator.translate("UUA")); |
| 44 | + } |
| 45 | + |
| 46 | + @Ignore("Remove to run test") |
| 47 | + @Test |
| 48 | + public void testLeucineRnaSequence2() { |
| 49 | + List<String> expected = Arrays.asList("Leucine"); |
| 50 | + assertEquals(expected, proteinTranslator.translate("UUG")); |
| 51 | + } |
| 52 | + |
| 53 | + @Ignore("Remove to run test") |
| 54 | + @Test |
| 55 | + public void testSerineRnaSequence1() { |
| 56 | + List<String> expected = Arrays.asList("Serine"); |
| 57 | + assertEquals(expected, proteinTranslator.translate("UCU")); |
| 58 | + } |
| 59 | + |
| 60 | + @Ignore("Remove to run test") |
| 61 | + @Test |
| 62 | + public void testSerineRnaSequence2() { |
| 63 | + List<String> expected = Arrays.asList("Serine"); |
| 64 | + assertEquals(expected, proteinTranslator.translate("UCC")); |
| 65 | + } |
| 66 | + |
| 67 | + @Ignore("Remove to run test") |
| 68 | + @Test |
| 69 | + public void testSerineRnaSequence3() { |
| 70 | + List<String> expected = Arrays.asList("Serine"); |
| 71 | + assertEquals(expected, proteinTranslator.translate("UCA")); |
| 72 | + } |
| 73 | + |
| 74 | + @Ignore("Remove to run test") |
| 75 | + @Test |
| 76 | + public void testSerineRnaSequence4() { |
| 77 | + List<String> expected = Arrays.asList("Serine"); |
| 78 | + assertEquals(expected, proteinTranslator.translate("UCG")); |
| 79 | + } |
| 80 | + |
| 81 | + @Ignore("Remove to run test") |
| 82 | + @Test |
| 83 | + public void testTyrosineRnaSequence1() { |
| 84 | + List<String> expected = Arrays.asList("Tyrosine"); |
| 85 | + assertEquals(expected, proteinTranslator.translate("UAU")); |
| 86 | + } |
| 87 | + |
| 88 | + @Ignore("Remove to run test") |
| 89 | + @Test |
| 90 | + public void testTyrosineRnaSequence2() { |
| 91 | + List<String> expected = Arrays.asList("Tyrosine"); |
| 92 | + assertEquals(expected, proteinTranslator.translate("UAC")); |
| 93 | + } |
| 94 | + |
| 95 | + @Ignore("Remove to run test") |
| 96 | + @Test |
| 97 | + public void testCysteineRnaSequence1() { |
| 98 | + List<String> expected = Arrays.asList("Cysteine"); |
| 99 | + assertEquals(expected, proteinTranslator.translate("UGU")); |
| 100 | + } |
| 101 | + |
| 102 | + @Ignore("Remove to run test") |
| 103 | + @Test |
| 104 | + public void testCysteineRnaSequence2() { |
| 105 | + List<String> expected = Arrays.asList("Cysteine"); |
| 106 | + assertEquals(expected, proteinTranslator.translate("UGC")); |
| 107 | + } |
| 108 | + |
| 109 | + @Ignore("Remove to run test") |
| 110 | + @Test |
| 111 | + public void testTryptophanRnaSequence1() { |
| 112 | + List<String> expected = Arrays.asList("Tryptophan"); |
| 113 | + assertEquals(expected, proteinTranslator.translate("UGG")); |
| 114 | + } |
| 115 | + |
| 116 | + @Ignore("Remove to run test") |
| 117 | + @Test |
| 118 | + public void testStopRnaSequence1() { |
| 119 | + List<String> expected = Arrays.asList(); |
| 120 | + assertEquals(expected, proteinTranslator.translate("UAA")); |
| 121 | + } |
| 122 | + |
| 123 | + @Ignore("Remove to run test") |
| 124 | + @Test |
| 125 | + public void testStopRnaSequence2() { |
| 126 | + List<String> expected = Arrays.asList(); |
| 127 | + assertEquals(expected, proteinTranslator.translate("UAG")); |
| 128 | + } |
| 129 | + |
| 130 | + @Ignore("Remove to run test") |
| 131 | + @Test |
| 132 | + public void testStopRnaSequence3() { |
| 133 | + List<String> expected = Arrays.asList(); |
| 134 | + assertEquals(expected, proteinTranslator.translate("UGA")); |
| 135 | + } |
| 136 | + |
| 137 | + @Ignore("Remove to run test") |
| 138 | + @Test |
| 139 | + public void testTranslationOfRnaToProteinList() { |
| 140 | + List<String> expected = Arrays.asList("Methionine","Phenylalanine","Tryptophan"); |
| 141 | + assertEquals(expected, proteinTranslator.translate("AUGUUUUGG")); |
| 142 | + } |
| 143 | + |
| 144 | + @Ignore("Remove to run test") |
| 145 | + @Test |
| 146 | + public void testTranslationStopsIfStopCodonAtBeginning() { |
| 147 | + List<String> expected = Arrays.asList(); |
| 148 | + assertEquals(expected, proteinTranslator.translate("UAGUGG")); |
| 149 | + } |
| 150 | + |
| 151 | + @Ignore("Remove to run test") |
| 152 | + @Test |
| 153 | + public void testTranslationStopsIfStopCodonAtEnd1() { |
| 154 | + List<String> expected = Arrays.asList("Tryptophan"); |
| 155 | + assertEquals(expected, proteinTranslator.translate("UGGUAG")); |
| 156 | + } |
| 157 | + |
| 158 | + @Ignore("Remove to run test") |
| 159 | + @Test |
| 160 | + public void testTranslationStopsIfStopCodonAtEnd2() { |
| 161 | + List<String> expected = Arrays.asList("Methionine", "Phenylalanine"); |
| 162 | + assertEquals(expected, proteinTranslator.translate("AUGUUUUAA")); |
| 163 | + } |
| 164 | + |
| 165 | + @Ignore("Remove to run test") |
| 166 | + @Test |
| 167 | + public void testTranslationStopsIfStopCodonInMiddle1() { |
| 168 | + List<String> expected = Arrays.asList("Tryptophan"); |
| 169 | + assertEquals(expected, proteinTranslator.translate("UGGUAGUGG")); |
| 170 | + } |
| 171 | + |
| 172 | + @Ignore("Remove to run test") |
| 173 | + @Test |
| 174 | + public void testTranslationStopsIfStopCodonInMiddle2() { |
| 175 | + List<String> expected = Arrays.asList("Tryptophan","Cysteine","Tyrosine"); |
| 176 | + assertEquals(expected, proteinTranslator.translate("UGGUGUUAUUAAUGGUUU")); |
| 177 | + } |
| 178 | + |
| 179 | +} |
0 commit comments