module Helpers open System.Text.RegularExpressions open System // The main aim of these functions is to reduce code in the unit and property tests. // You will most-likely find them in the "contents" tests (for unit and property). let CountSentences text = let count = Regex.Split(text, @"(?<=[\.\!\?]\s)") |> Array.length count let EndsAsIntended (text: string) = match text.Chars (text.Length - 1) with | '.' -> true | '!' -> true | '?' -> true | _ -> false let RandomBool () = let x = Random().Next(100) match x with | x when x % 2 <> 0 -> false | x when x % 2 = 0 -> true | _ -> failwith "Unable to generate a random bool."