module NucleoTideCountTest open Xunit open FsUnit.Xunit open System open NucleoTideCount [] let ``Has no nucleotides`` () = let strand = "" let expected = [ ( 'A', 0 ); ( 'T', 0 ); ( 'C', 0 ); ( 'G', 0 ) ] |> Map.ofSeq nucleotideCounts strand |> should equal expected [] let ``Has no adenosine`` () = let strand = "" count 'A' strand |> should equal 0 [] let ``Repetitive cytidine gets counts`` () = let strand = "CCCCC" count 'C' strand |> should equal 5 [] let ``Repetitive sequence has only guanosine`` () = let strand = "GGGGGGGG" let expected = [ ( 'A', 0 ); ( 'T', 0 ); ( 'C', 0 ); ( 'G', 8 ) ] |> Map.ofSeq nucleotideCounts strand |> should equal expected [] let ``Counts only thymidine`` () = let strand = "GGGGTAACCCGG" count 'T' strand |> should equal 1 [] let ``Validates nucleotides`` () = let strand = "GGTTGG" (fun () -> count 'X' strand |> ignore) |> should throw typeof [] let ``Counts all nucleotides`` () = let strand = "AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC" let expected = [ ( 'A', 20 ); ( 'T', 21 ); ( 'C', 12 ); ( 'G', 17 ) ] |> Map.ofSeq nucleotideCounts strand |> should equal expected