module ProteinTranslationTest open Xunit open FsUnit.Xunit open System open ProteinTranslation [] [] let ``Identifies Methionine codons`` (codon) = translate codon |> should equal ["Methionine"] [] [] [] let ``Identifies Phenylalanine codons`` (codon) = translate codon |> should equal ["Phenylalanine"] [] [] [] let ``Identifies Leucine codons`` (codon) = translate codon |> should equal ["Leucine"] [] [] [] [] [] let ``Identifies Serine codons`` (codon) = translate codon |> should equal ["Serine"] [] [] [] let ``Identifies Tyrosine codons`` (codon) = translate codon |> should equal ["Tyrosine"] [] [] [] let ``Identifies Cysteine codons`` (codon) = translate codon |> should equal ["Cysteine"] [] [] let ``Identifies Tryptophan codons`` (codon) = translate codon |> should equal ["Tryptophan"] [] let ``Translates rna strand into correct protein`` () = translate "AUGUUUUGG" |> should equal ["Methionine"; "Phenylalanine"; "Tryptophan"] [] let ``Stops translation if stop codon present`` () = translate "AUGUUUUAA" |> should equal ["Methionine"; "Phenylalanine"] [] let ``Stops translation of longer strand`` () = translate "UGGUGUUAUUAAUGGUUU'" |> should equal ["Tryptophan"; "Cysteine"; "Tyrosine"] [] let ``Throws for invalid codons`` () = (fun () -> translate "CARROT'" |> List.ofSeq |> ignore) |> should throw typeof