|
|
|
@ -4,7 +4,9 @@
|
|
|
|
|
open WetPancake |
|
|
|
|
open TestingConstants |
|
|
|
|
open System.IO |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// File Access Checks ===================================================================================================== |
|
|
|
|
|
|
|
|
|
(* These tests check to see if the .txt files exists in the Test Centre project. |
|
|
|
|
The WetPancake library does not expose the file access functions so the .txt files are mirrored here (in Test Centre). |
|
|
|
|
The mirroring, also, doubles up as sample files to pass into WetPancake. *) |
|
|
|
@ -28,10 +30,12 @@
|
|
|
|
|
let ``test-post can be found`` () = |
|
|
|
|
let result = File.Exists TestPost |
|
|
|
|
Assert.Equal(true, result) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Null Checks ========================================================================================================== |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestRandomText does not return a null`` () = |
|
|
|
|
let result = Pancake.RequestRandomText |
|
|
|
|
let result = Pancake.RequestRandomText () |
|
|
|
|
Assert.NotNull result |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
@ -67,4 +71,11 @@
|
|
|
|
|
let gibberishLevel = System.Random().Next(2, 20) |
|
|
|
|
let totalSentences = System.Random().Next(2, 20) |
|
|
|
|
let result = Pancake.RequestTextFromFile gibberishLevel totalSentences TestPost |
|
|
|
|
Assert.NotNull result |
|
|
|
|
Assert.NotNull result |
|
|
|
|
|
|
|
|
|
// Contents Checks ======================================================================================================== |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestRandomText returns a string which contains at least one full stop`` () = |
|
|
|
|
let result = Pancake.RequestRandomText () |> Async.RunSynchronously |
|
|
|
|
Assert.Contains(".", result) |