1
exercism fetch fsharp protein-translation

ProteinTranslationTest.fs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// This file was auto-generated based on version 1.1.0 of the canonical data.

module ProteinTranslationTest

open FsUnit.Xunit
open Xunit

open ProteinTranslation

[<Fact>]
let ``Methionine RNA sequence`` () =
    proteins "AUG" |> should equal ["Methionine"]

[<Fact(Skip = "Remove to run test")>]
let ``Phenylalanine RNA sequence 1`` () =
    proteins "UUU" |> should equal ["Phenylalanine"]

[<Fact(Skip = "Remove to run test")>]
let ``Phenylalanine RNA sequence 2`` () =
    proteins "UUC" |> should equal ["Phenylalanine"]

[<Fact(Skip = "Remove to run test")>]
let ``Leucine RNA sequence 1`` () =
    proteins "UUA" |> should equal ["Leucine"]

[<Fact(Skip = "Remove to run test")>]
let ``Leucine RNA sequence 2`` () =
    proteins "UUG" |> should equal ["Leucine"]

[<Fact(Skip = "Remove to run test")>]
let ``Serine RNA sequence 1`` () =
    proteins "UCU" |> should equal ["Serine"]

[<Fact(Skip = "Remove to run test")>]
let ``Serine RNA sequence 2`` () =
    proteins "UCC" |> should equal ["Serine"]

[<Fact(Skip = "Remove to run test")>]
let ``Serine RNA sequence 3`` () =
    proteins "UCA" |> should equal ["Serine"]

[<Fact(Skip = "Remove to run test")>]
let ``Serine RNA sequence 4`` () =
    proteins "UCG" |> should equal ["Serine"]

[<Fact(Skip = "Remove to run test")>]
let ``Tyrosine RNA sequence 1`` () =
    proteins "UAU" |> should equal ["Tyrosine"]

[<Fact(Skip = "Remove to run test")>]
let ``Tyrosine RNA sequence 2`` () =
    proteins "UAC" |> should equal ["Tyrosine"]

[<Fact(Skip = "Remove to run test")>]
let ``Cysteine RNA sequence 1`` () =
    proteins "UGU" |> should equal ["Cysteine"]

[<Fact(Skip = "Remove to run test")>]
let ``Cysteine RNA sequence 2`` () =
    proteins "UGC" |> should equal ["Cysteine"]

[<Fact(Skip = "Remove to run test")>]
let ``Tryptophan RNA sequence`` () =
    proteins "UGG" |> should equal ["Tryptophan"]

[<Fact(Skip = "Remove to run test")>]
let ``STOP codon RNA sequence 1`` () =
    proteins "UAA" |> should be Empty

[<Fact(Skip = "Remove to run test")>]
let ``STOP codon RNA sequence 2`` () =
    proteins "UAG" |> should be Empty

[<Fact(Skip = "Remove to run test")>]
let ``STOP codon RNA sequence 3`` () =
    proteins "UGA" |> should be Empty

[<Fact(Skip = "Remove to run test")>]
let ``Translate RNA strand into correct protein list`` () =
    proteins "AUGUUUUGG" |> should equal ["Methionine"; "Phenylalanine"; "Tryptophan"]

[<Fact(Skip = "Remove to run test")>]
let ``Translation stops if STOP codon at beginning of sequence`` () =
    proteins "UAGUGG" |> should be Empty

[<Fact(Skip = "Remove to run test")>]
let ``Translation stops if STOP codon at end of two-codon sequence`` () =
    proteins "UGGUAG" |> should equal ["Tryptophan"]

[<Fact(Skip = "Remove to run test")>]
let ``Translation stops if STOP codon at end of three-codon sequence`` () =
    proteins "AUGUUUUAA" |> should equal ["Methionine"; "Phenylalanine"]

[<Fact(Skip = "Remove to run test")>]
let ``Translation stops if STOP codon in middle of three-codon sequence`` () =
    proteins "UGGUAGUGG" |> should equal ["Tryptophan"]

[<Fact(Skip = "Remove to run test")>]
let ``Translation stops if STOP codon in middle of six-codon sequence`` () =
    proteins "UGGUGUUAUUAAUGGUUU" |> should equal ["Tryptophan"; "Cysteine"; "Tyrosine"]