diff --git a/TestCentre/InputGeneration.fs b/TestCentre/InputGeneration.fs index 9ff63bf..68ac7e1 100644 --- a/TestCentre/InputGeneration.fs +++ b/TestCentre/InputGeneration.fs @@ -10,7 +10,7 @@ let ValidSentencesInput () = System.Random().Next(2, 10) - let InvalidGibberishInput () = + let InvalidGibberishLevelInput () = let testInputs = Array.concat [ [|0; 1|] ; [|21 .. 100|] ] let index = System.Random().Next(0, testInputs.Length) testInputs.[index] diff --git a/WetPancake/ProductServices.fs b/WetPancake/ProductServices.fs index 7eb0118..1fc4779 100644 --- a/WetPancake/ProductServices.fs +++ b/WetPancake/ProductServices.fs @@ -21,7 +21,6 @@ module Pancake = return GenerateMarkovText (PickRandomNumber 2 10) data } - // TODO: Write tests for the validation checks (throws exceptions) let RequestTextAsync (gibberishLevel: int) (sentences: int) = async { try @@ -38,7 +37,6 @@ module Pancake = return ex.Message } - // TODO: Write tests for the validation checks (throws exceptions) let RequestTextFromFileAsync (gibberishLevel: int) (sentences: int) (filePath: string) = async { try diff --git a/WetPancake/Script.fsx b/WetPancake/Script.fsx index cc698cf..759b0d4 100644 --- a/WetPancake/Script.fsx +++ b/WetPancake/Script.fsx @@ -16,6 +16,7 @@ open DataProcessing open DataStructuring open DataServices open WetPancake +open System // System Services let ss_number = PickRandomNumber 10 @@ -79,6 +80,15 @@ let dp_combine4 = let prev = "Next is null" let next = null CombineWords prev next +let dp_invalidGibberish = + try + GibberishLevelIsValid 0 + |> ignore + "No exception thrown" + with :? ArgumentException as ex -> ex.Message + + + (* Functions to include: =====================