@@ -12,107 +12,141 @@ using namespace std;
12
12
13
13
// Secret-handshake exercise test case data version 1.2.1
14
14
15
- TEST_CASE (" Methionine_RNA_sequence " ) {
15
+ TEST_CASE (" Methionine RNA sequence " , " [96d3d44f-34a2-4db4-84cd-fff523e069be] " ) {
16
16
REQUIRE (vector<string>{" Methionine" } ==
17
17
protein_translation::proteins (" AUG" ));
18
18
}
19
19
20
20
#if defined(EXERCISM_RUN_ALL_TESTS)
21
21
22
- TEST_CASE (" Phenylalanine_RNA_sequence_1" ) {
22
+ TEST_CASE (" Phenylalanine RNA sequence 1" ,
23
+ " [1b4c56d8-d69f-44eb-be0e-7b17546143d9]" ) {
23
24
REQUIRE (vector<string>{" Phenylalanine" } ==
24
25
protein_translation::proteins (" UUU" ));
25
26
}
26
27
27
- TEST_CASE (" Phenylalanine_RNA_sequence_2" ) {
28
+ TEST_CASE (" Phenylalanine RNA sequence 2" ,
29
+ " [81b53646-bd57-4732-b2cb-6b1880e36d11]" ) {
28
30
REQUIRE (vector<string>{" Phenylalanine" } ==
29
31
protein_translation::proteins (" UUC" ));
30
32
}
31
33
32
- TEST_CASE (" Leucine_RNA_sequence_1 " ) {
34
+ TEST_CASE (" Leucine RNA sequence 1 " , " [42f69d4f-19d2-4d2c-a8b0-f0ae9ee1b6b4] " ) {
33
35
REQUIRE (vector<string>{" Leucine" } == protein_translation::proteins (" UUA" ));
34
36
}
35
37
36
- TEST_CASE (" Leucine_RNA_sequence_2 " ) {
38
+ TEST_CASE (" Leucine RNA sequence 2 " , " [ac5edadd-08ed-40a3-b2b9-d82bb50424c4] " ) {
37
39
REQUIRE (vector<string>{" Leucine" } == protein_translation::proteins (" UUG" ));
38
40
}
39
41
40
- TEST_CASE (" Serine_RNA_sequence_1 " ) {
42
+ TEST_CASE (" Serine RNA sequence 1 " , " [8bc36e22-f984-44c3-9f6b-ee5d4e73f120] " ) {
41
43
REQUIRE (vector<string>{" Serine" } == protein_translation::proteins (" UCU" ));
42
44
}
43
45
44
- TEST_CASE (" Serine_RNA_sequence_2 " ) {
46
+ TEST_CASE (" Serine RNA sequence 2 " , " [5c3fa5da-4268-44e5-9f4b-f016ccf90131] " ) {
45
47
REQUIRE (vector<string>{" Serine" } == protein_translation::proteins (" UCC" ));
46
48
}
47
49
48
- TEST_CASE (" Serine_RNA_sequence_3 " ) {
50
+ TEST_CASE (" Serine RNA sequence 3 " , " [00579891-b594-42b4-96dc-7ff8bf519606] " ) {
49
51
REQUIRE (vector<string>{" Serine" } == protein_translation::proteins (" UCA" ));
50
52
}
51
53
52
- TEST_CASE (" Serine_RNA_sequence_4 " ) {
54
+ TEST_CASE (" Serine RNA sequence 4 " , " [08c61c3b-fa34-4950-8c4a-133945570ef6] " ) {
53
55
REQUIRE (vector<string>{" Serine" } == protein_translation::proteins (" UCG" ));
54
56
}
55
57
56
- TEST_CASE (" Tyrosine_RNA_sequence_1 " ) {
58
+ TEST_CASE (" Tyrosine RNA sequence 1 " , " [54e1e7d8-63c0-456d-91d2-062c72f8eef5] " ) {
57
59
REQUIRE (vector<string>{" Tyrosine" } == protein_translation::proteins (" UAU" ));
58
60
}
59
61
60
- TEST_CASE (" Tyrosine_RNA_sequence_2 " ) {
62
+ TEST_CASE (" Tyrosine RNA sequence 2 " , " [47bcfba2-9d72-46ad-bbce-22f7666b7eb1] " ) {
61
63
REQUIRE (vector<string>{" Tyrosine" } == protein_translation::proteins (" UAC" ));
62
64
}
63
65
64
- TEST_CASE (" Cysteine_RNA_sequence_1 " ) {
66
+ TEST_CASE (" Cysteine RNA sequence 1 " , " [3a691829-fe72-43a7-8c8e-1bd083163f72] " ) {
65
67
REQUIRE (vector<string>{" Cysteine" } == protein_translation::proteins (" UGU" ));
66
68
}
67
69
68
- TEST_CASE (" Cysteine_RNA_sequence_2 " ) {
70
+ TEST_CASE (" Cysteine RNA sequence 2 " , " [1b6f8a26-ca2f-43b8-8262-3ee446021767] " ) {
69
71
REQUIRE (vector<string>{" Cysteine" } == protein_translation::proteins (" UGC" ));
70
72
}
71
73
72
- TEST_CASE (" Tryptophan_RNA_sequence " ) {
74
+ TEST_CASE (" Tryptophan RNA sequence " , " [1e91c1eb-02c0-48a0-9e35-168ad0cb5f39] " ) {
73
75
REQUIRE (vector<string>{" Tryptophan" } ==
74
76
protein_translation::proteins (" UGG" ));
75
77
}
76
78
77
- TEST_CASE (" STOP_codon_RNA_sequence_1" ) {
79
+ TEST_CASE (" STOP codon RNA sequence 1" ,
80
+ " [e547af0b-aeab-49c7-9f13-801773a73557]" ) {
78
81
REQUIRE (vector<string>{} == protein_translation::proteins (" UAA" ));
79
82
}
80
83
81
- TEST_CASE (" STOP_codon_RNA_sequence_2" ) {
84
+ TEST_CASE (" STOP codon RNA sequence 2" ,
85
+ " [67640947-ff02-4f23-a2ef-816f8a2ba72e]" ) {
82
86
REQUIRE (vector<string>{} == protein_translation::proteins (" UAG" ));
83
87
}
84
88
85
- TEST_CASE (" STOP_codon_RNA_sequence_3" ) {
89
+ TEST_CASE (" STOP codon RNA sequence 3" ,
90
+ " [9c2ad527-ebc9-4ace-808b-2b6447cb54cb]" ) {
86
91
REQUIRE (vector<string>{} == protein_translation::proteins (" UGA" ));
87
92
}
88
93
89
- TEST_CASE (" Translate_RNA_strand_into_correct_protein_list" ) {
94
+ TEST_CASE (" Translate RNA strand into correct protein list" ,
95
+ " [d0f295df-fb70-425c-946c-ec2ec185388e]" ) {
90
96
REQUIRE (vector<string>{" Methionine" , " Phenylalanine" , " Tryptophan" } ==
91
97
protein_translation::proteins (" AUGUUUUGG" ));
92
98
}
93
99
94
- TEST_CASE (" Translation_stops_if_STOP_codon_at_beginning_of_sequence" ) {
100
+ TEST_CASE (" Sequence of two protein codons translates into proteins" ,
101
+ " [f4d9d8ee-00a8-47bf-a1e3-1641d4428e54]" ) {
102
+ REQUIRE (vector<string>{" Phenylalanine" , " Phenylalanine" } ==
103
+ protein_translation::proteins (" UUUUUU" ));
104
+ }
105
+
106
+ TEST_CASE (" Sequence of two different protein codons translates into proteins" ,
107
+ " [dd22eef3-b4f1-4ad6-bb0b-27093c090a9d]" ) {
108
+ REQUIRE (vector<string>{" Leucine" , " Leucine" } ==
109
+ protein_translation::proteins (" UUAUUG" ));
110
+ }
111
+
112
+ TEST_CASE (" Empty RNA sequence results in no proteins" ,
113
+ " [2c44f7bf-ba20-43f7-a3bf-f2219c0c3f98]" ) {
114
+ REQUIRE (vector<string>{} == protein_translation::proteins (" " ));
115
+ }
116
+
117
+ TEST_CASE (" Translation stops if STOP codon at beginning of sequence" ,
118
+ " [e30e8505-97ec-4e5f-a73e-5726a1faa1f4]" ) {
95
119
REQUIRE (vector<string>{} == protein_translation::proteins (" UAGUGG" ));
96
120
}
97
121
98
- TEST_CASE (" Translation_stops_if_STOP_codon_at_end_of_two-codon_sequence" ) {
122
+ TEST_CASE (" Translation stops if STOP codon at end of two-codon sequence" ,
123
+ " [5358a20b-6f4c-4893-bce4-f929001710f3]" ) {
99
124
REQUIRE (vector<string>{" Tryptophan" } ==
100
125
protein_translation::proteins (" UGGUAG" ));
101
126
}
102
127
103
- TEST_CASE (" Translation_stops_if_STOP_codon_at_end_of_three-codon_sequence" ) {
128
+ TEST_CASE (" Translation stops if STOP codon at end of three-codon sequence" ,
129
+ " [ba16703a-1a55-482f-bb07-b21eef5093a3]" ) {
104
130
REQUIRE (vector<string>{" Methionine" , " Phenylalanine" } ==
105
131
protein_translation::proteins (" AUGUUUUAA" ));
106
132
}
107
133
108
- TEST_CASE (" Translation_stops_if_STOP_codon_in_middle_of_three-codon_sequence" ) {
134
+ TEST_CASE (" Translation stops if STOP codon in middle of three-codon sequence" ,
135
+ " [4089bb5a-d5b4-4e71-b79e-b8d1f14a2911]" ) {
109
136
REQUIRE (vector<string>{" Tryptophan" } ==
110
137
protein_translation::proteins (" UGGUAGUGG" ));
111
138
}
112
139
113
- TEST_CASE (" Translation_stops_if_STOP_codon_in_middle_of_six-codon_sequence" ) {
140
+ TEST_CASE (" Translation stops if STOP codon in middle of six-codon sequence" ,
141
+ " [2c2a2a60-401f-4a80-b977-e0715b23b93d]" ) {
114
142
REQUIRE (vector<string>{" Tryptophan" , " Cysteine" , " Tyrosine" } ==
115
143
protein_translation::proteins (" UGGUGUUAUUAAUGGUUU" ));
116
144
}
117
145
146
+ TEST_CASE (" Sequence of two non-STOP codons does not translate to a STOP codon" ,
147
+ " [f6f92714-769f-4187-9524-e353e8a41a80]" ) {
148
+ REQUIRE (vector<string>{" Methionine" , " Methionine" } ==
149
+ protein_translation::proteins (" AUGAUG" ));
150
+ }
151
+
118
152
#endif // !EXERCISM_RUN_ALL_TESTS
0 commit comments