|
|
|
@ -41,7 +41,7 @@
|
|
|
|
|
let test () = |
|
|
|
|
Pancake.RequestTextAsync 5 (ValidSentencesInput()) |
|
|
|
|
|> Async.RunSynchronously |
|
|
|
|
let results () = Assert.NotNull test |
|
|
|
|
let results = Assert.NotNull test |
|
|
|
|
Check.Quick results |
|
|
|
|
|
|
|
|
|
[<Property>] |
|
|
|
@ -201,6 +201,12 @@
|
|
|
|
|
|
|
|
|
|
module ``Exception Tests`` = |
|
|
|
|
|
|
|
|
|
(* |
|
|
|
|
let expectDivideByZero() = Prop.throws<DivideByZeroException,_> (lazy (raise <| DivideByZeroException())) |
|
|
|
|
Check.Quick expectDivideByZero |
|
|
|
|
*) |
|
|
|
|
(* |
|
|
|
|
|
|
|
|
|
[<Property>] |
|
|
|
|
let ``RequestText throws an ArgumentException when the gibberishLevel is invalid`` () = |
|
|
|
|
let test = |
|
|
|
@ -209,6 +215,15 @@
|
|
|
|
|
let results = |
|
|
|
|
lazy Assert.Throws<ArgumentException>(fun () -> test |> ignore) |
|
|
|
|
Check.Quick results |
|
|
|
|
*) |
|
|
|
|
|
|
|
|
|
//THIS IS A ROUGH TEST -- TO DELETE |
|
|
|
|
[<Property>] |
|
|
|
|
let ``RequestText throws an ArgumentException when the gibberishLevel is invalid`` () = |
|
|
|
|
let test = |
|
|
|
|
Pancake.RequestTextAsync 5 5 |
|
|
|
|
|> Async.RunSynchronously |
|
|
|
|
Check.Quick (test) |
|
|
|
|
|
|
|
|
|
[<Property>] |
|
|
|
|
let ``RequestText throws an ArgumentException when the sentences count is invalid`` () = |
|
|
|
@ -220,12 +235,21 @@
|
|
|
|
|
Check.Quick results |
|
|
|
|
|
|
|
|
|
[<Property>] |
|
|
|
|
let ``RequestTextFromFile throws an ArgumentException when the gibberishLeel in invalid`` () = |
|
|
|
|
let test = |
|
|
|
|
let ``RequestTextFromFile throws an ArgumentException when the gibberishLevel in invalid`` () = |
|
|
|
|
let test () = |
|
|
|
|
Pancake.RequestTextFromFileAsync (InvalidGibberishInput()) (ValidSentencesInput()) (ValidFileInput()) |
|
|
|
|
|> Async.RunSynchronously |
|
|
|
|
let results = |
|
|
|
|
lazy Assert.Throws<ArgumentException>(fun () -> test |> ignore) |
|
|
|
|
Check.QuickThrowOnFailure results |
|
|
|
|
|
|
|
|
|
[<Property>] |
|
|
|
|
let ``RequestTextFromFile throws an ArgumentException when the sentences count is invalid`` () = |
|
|
|
|
let test () = |
|
|
|
|
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (InvalidSentencesInput()) (ValidFileInput()) |
|
|
|
|
|> Async.RunSynchronously |
|
|
|
|
let results = |
|
|
|
|
lazy Assert.Throws<ArgumentException>(fun () -> test |> ignore) |
|
|
|
|
Check.Quick results |
|
|
|
|
(* |
|
|
|
|
let SentencesIsValid sentences = |
|
|
|
|