module ProteinTranslationTest open NUnit.Framework open ProteinTranslation [] let ``Identifies Methionine codons`` (codon) = Assert.That(translate codon, Is.EqualTo(["Methionine"])) [] [] let ``Identifies Phenylalanine codons`` (codon) = Assert.That(translate codon, Is.EqualTo(["Phenylalanine"])) [] [] let ``Identifies Leucine codons`` (codon) = Assert.That(translate codon, Is.EqualTo(["Leucine"])) [] [] [] [] let ``Identifies Serine codons`` (codon) = Assert.That(translate codon, Is.EqualTo(["Serine"])) [] [] let ``Identifies Tyrosine codons`` (codon) = Assert.That(translate codon, Is.EqualTo(["Tyrosine"])) [] [] let ``Identifies Cysteine codons`` (codon) = Assert.That(translate codon, Is.EqualTo(["Cysteine"])) [] let ``Identifies Tryptophan codons`` (codon) = Assert.That(translate codon, Is.EqualTo(["Tryptophan"])) [] [] let ``Translates rna strand into correct protein`` () = Assert.That(translate "AUGUUUUGG", Is.EqualTo(["Methionine"; "Phenylalanine"; "Tryptophan"])) [] [] let ``Stops translation if stop codon present`` () = Assert.That(translate "AUGUUUUAA", Is.EqualTo(["Methionine"; "Phenylalanine"])) [] [] let ``Stops translation of longer strand`` () = Assert.That(translate "UGGUGUUAUUAAUGGUUU'", Is.EqualTo(["Tryptophan"; "Cysteine"; "Tyrosine"])) [] [] let ``Throws for invalid codons`` () = Assert.That((fun () -> translate "CARROT'" |> List.ofSeq |> ignore), Throws.Exception)