|
|
|
@ -161,38 +161,4 @@
|
|
|
|
|
let result = |
|
|
|
|
Pancake.RequestAllTemplateFilesAsync () |
|
|
|
|
|> Async.RunSynchronously |
|
|
|
|
Assert.NotEmpty result |
|
|
|
|
|
|
|
|
|
module ``Exception Tests`` = |
|
|
|
|
|
|
|
|
|
(* |
|
|
|
|
let SentencesIsValid sentences = |
|
|
|
|
let FilePathIsValid filePath |
|
|
|
|
*) |
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestText throws an ArgumentException when the gibberishLevel is invalid`` () = |
|
|
|
|
let test () = |
|
|
|
|
Pancake.RequestTextAsync (InvalidGibberishInput()) (ValidSentencesInput()) |
|
|
|
|
|> Async.RunSynchronously |
|
|
|
|
lazy Assert.Throws<ArgumentException>(fun () -> test() |> ignore) |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestText throws an ArgumentException when the sentences count is invalid`` () = |
|
|
|
|
let test () = |
|
|
|
|
Pancake.RequestTextAsync (ValidGibberishLevelInput()) (InvalidSentencesInput()) |
|
|
|
|
|> Async.RunSynchronously |
|
|
|
|
lazy Assert.Throws<ArgumentException>(fun () -> test |> ignore) |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestTextFromFile throws an ArgumentException when the gibberishLevel is invalid`` () = |
|
|
|
|
let test () = |
|
|
|
|
Pancake.RequestTextFromFileAsync (InvalidGibberishInput()) (ValidSentencesInput()) (ValidFileInput()) |
|
|
|
|
|> Async.RunSynchronously |
|
|
|
|
lazy Assert.Throws<ArgumentException>(fun () -> test |> ignore) |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestTextFromFile throws an ArgumentException when the sentences count is invalid`` () = |
|
|
|
|
let test () = |
|
|
|
|
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (InvalidSentencesInput()) (ValidFileInput()) |
|
|
|
|
|> Async.RunSynchronously |
|
|
|
|
lazy Assert.Throws<ArgumentException>(fun () -> test |> ignore) |
|
|
|
|
Assert.NotEmpty result |