|
| 1 | +func test_methionine_rna_sequence(solution_script): |
| 2 | + var value = "AUG" |
| 3 | + var expected = ["Methionine"] |
| 4 | + return [solution_script.proteins(value), expected] |
| 5 | + |
| 6 | + |
| 7 | +func test_phenylalanine_rna_sequence_1(solution_script): |
| 8 | + var value = "UUU" |
| 9 | + var expected = ["Phenylalanine"] |
| 10 | + return [solution_script.proteins(value), expected] |
| 11 | + |
| 12 | + |
| 13 | +func test_phenylalanine_rna_sequence_2(solution_script): |
| 14 | + var value = "UUC" |
| 15 | + var expected = ["Phenylalanine"] |
| 16 | + return [solution_script.proteins(value), expected] |
| 17 | + |
| 18 | + |
| 19 | +func test_leucine_rna_sequence_1(solution_script): |
| 20 | + var value = "UUA" |
| 21 | + var expected = ["Leucine"] |
| 22 | + return [solution_script.proteins(value), expected] |
| 23 | + |
| 24 | + |
| 25 | +func test_leucine_rna_sequence_2(solution_script): |
| 26 | + var value = "UUG" |
| 27 | + var expected = ["Leucine"] |
| 28 | + return [solution_script.proteins(value), expected] |
| 29 | + |
| 30 | + |
| 31 | +func test_serine_rna_sequence_1(solution_script): |
| 32 | + var value = "UCU" |
| 33 | + var expected = ["Serine"] |
| 34 | + return [solution_script.proteins(value), expected] |
| 35 | + |
| 36 | + |
| 37 | +func test_serine_rna_sequence_2(solution_script): |
| 38 | + var value = "UCC" |
| 39 | + var expected = ["Serine"] |
| 40 | + return [solution_script.proteins(value), expected] |
| 41 | + |
| 42 | + |
| 43 | +func test_serine_rna_sequence_3(solution_script): |
| 44 | + var value = "UCA" |
| 45 | + var expected = ["Serine"] |
| 46 | + return [solution_script.proteins(value), expected] |
| 47 | + |
| 48 | + |
| 49 | +func test_serine_rna_sequence_4(solution_script): |
| 50 | + var value = "UCG" |
| 51 | + var expected = ["Serine"] |
| 52 | + return [solution_script.proteins(value), expected] |
| 53 | + |
| 54 | + |
| 55 | +func test_tyrosine_rna_sequence_1(solution_script): |
| 56 | + var value = "UAU" |
| 57 | + var expected = ["Tyrosine"] |
| 58 | + return [solution_script.proteins(value), expected] |
| 59 | + |
| 60 | + |
| 61 | +func test_tyrosine_rna_sequence_2(solution_script): |
| 62 | + var value = "UAC" |
| 63 | + var expected = ["Tyrosine"] |
| 64 | + return [solution_script.proteins(value), expected] |
| 65 | + |
| 66 | + |
| 67 | +func test_cysteine_rna_sequence_1(solution_script): |
| 68 | + var value = "UGU" |
| 69 | + var expected = ["Cysteine"] |
| 70 | + return [solution_script.proteins(value), expected] |
| 71 | + |
| 72 | + |
| 73 | +func test_cysteine_rna_sequence_2(solution_script): |
| 74 | + var value = "UGC" |
| 75 | + var expected = ["Cysteine"] |
| 76 | + return [solution_script.proteins(value), expected] |
| 77 | + |
| 78 | + |
| 79 | +func test_tryptophan_rna_sequence(solution_script): |
| 80 | + var value = "UGG" |
| 81 | + var expected = ["Tryptophan"] |
| 82 | + return [solution_script.proteins(value), expected] |
| 83 | + |
| 84 | + |
| 85 | +func test_stop_codon_rna_sequence_1(solution_script): |
| 86 | + var value = "UAA" |
| 87 | + var expected = [] |
| 88 | + return [solution_script.proteins(value), expected] |
| 89 | + |
| 90 | + |
| 91 | +func test_stop_codon_rna_sequence_2(solution_script): |
| 92 | + var value = "UAG" |
| 93 | + var expected = [] |
| 94 | + return [solution_script.proteins(value), expected] |
| 95 | + |
| 96 | + |
| 97 | +func test_stop_codon_rna_sequence_3(solution_script): |
| 98 | + var value = "UGA" |
| 99 | + var expected = [] |
| 100 | + return [solution_script.proteins(value), expected] |
| 101 | + |
| 102 | + |
| 103 | +func test_sequence_of_two_protein_codons_translates_into_proteins(solution_script): |
| 104 | + var value = "UUUUUU" |
| 105 | + var expected = ["Phenylalanine", "Phenylalanine"] |
| 106 | + return [solution_script.proteins(value), expected] |
| 107 | + |
| 108 | + |
| 109 | +func test_sequence_of_two_different_protein_codons_translates_into_proteins(solution_script): |
| 110 | + var value = "UUAUUG" |
| 111 | + var expected = ["Leucine", "Leucine"] |
| 112 | + return [solution_script.proteins(value), expected] |
| 113 | + |
| 114 | + |
| 115 | +func test_translate_rna_strand_into_correct_protein_list(solution_script): |
| 116 | + var value = "AUGUUUUGG" |
| 117 | + var expected = ["Methionine", "Phenylalanine", "Tryptophan"] |
| 118 | + return [solution_script.proteins(value), expected] |
| 119 | + |
| 120 | + |
| 121 | +func test_translation_stops_if_stop_codon_at_beginning_of_sequence(solution_script): |
| 122 | + var value = "UAGUGG" |
| 123 | + var expected = [] |
| 124 | + return [solution_script.proteins(value), expected] |
| 125 | + |
| 126 | + |
| 127 | +func test_translation_stops_if_stop_codon_at_end_of_two_codon_sequence(solution_script): |
| 128 | + var value = "UGGUAG" |
| 129 | + var expected = ["Tryptophan"] |
| 130 | + return [solution_script.proteins(value), expected] |
| 131 | + |
| 132 | + |
| 133 | +func test_translation_stops_if_stop_codon_at_end_of_three_codon_sequence(solution_script): |
| 134 | + var value = "AUGUUUUAA" |
| 135 | + var expected = ["Methionine", "Phenylalanine"] |
| 136 | + return [solution_script.proteins(value), expected] |
| 137 | + |
| 138 | + |
| 139 | +func test_translation_stops_if_stop_codon_in_middle_of_three_codon_sequence(solution_script): |
| 140 | + var value = "UGGUAGUGG" |
| 141 | + var expected = ["Tryptophan"] |
| 142 | + return [solution_script.proteins(value), expected] |
| 143 | + |
| 144 | + |
| 145 | +func test_translation_stops_if_stop_codon_in_middle_of_six_codon_sequence(solution_script): |
| 146 | + var value = "UGGUGUUAUUAAUGGUUU" |
| 147 | + var expected = ["Tryptophan", "Cysteine", "Tyrosine"] |
| 148 | + return [solution_script.proteins(value), expected] |
| 149 | + |
| 150 | + |
0 commit comments