Browse Source

Finished writting exception tests for RequestText.

master
Craig Oates 6 years ago
parent
commit
112ae8ad1b
  1. 10
      TestCentre/PropertyTests.fs
  2. 15
      TestCentre/UnitTests.fs

10
TestCentre/PropertyTests.fs

@ -203,13 +203,21 @@
[<Property>]
let ``RequestText throws an ArgumentException when the gibberishLevel is invalid`` () =
let test () =
let test =
Pancake.RequestTextAsync (InvalidGibberishInput()) (ValidSentencesInput())
|> Async.RunSynchronously
let results =
lazy Assert.Throws<ArgumentException>(fun () -> test |> ignore)
Check.Quick results
[<Property>]
let ``RequestText throws an ArgumentException when the sentences count is invalid`` () =
let test =
Pancake.RequestTextAsync (ValidGibberishLevelInput()) (InvalidSentencesInput())
|> Async.RunSynchronously
let results =
lazy Assert.Throws<ArgumentException>(fun () -> test |> ignore)
Check.Quick results
(*
let SentencesIsValid sentences =
let FilePathIsValid filePath

15
TestCentre/UnitTests.fs

@ -164,10 +164,21 @@
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) |> ignore
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)

Loading…
Cancel
Save