The purpose of this repository is to provide a way for people to generate random "placeholder text" -- with a Markov Chain.
https://www.craigoates.net/Software/project/12
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
191 lines
8.1 KiB
191 lines
8.1 KiB
module PropertyTests |
|
|
|
open FsCheck |
|
open global.Xunit |
|
open FsCheck.Xunit |
|
open WetPancake |
|
open TestingConstants |
|
open System.Diagnostics |
|
open System |
|
open InputGeneration |
|
|
|
module ``Null Tests`` = |
|
|
|
[<Property>] |
|
let ``Request Random Text does not return a null when using the built-in random settings`` () = |
|
let test = |
|
Pancake.RequestRandomTextAsync () |
|
|> Async.RunSynchronously |
|
let results = Assert.NotNull test |
|
Check.Quick results |
|
|
|
[<Property>] |
|
let ``Request Text does not return a null when using fixed input parameters`` () = |
|
// Change the values for a quick way to manually test the (test) code. |
|
let test ()= |
|
Pancake.RequestTextAsync 5 5 |
|
|> Async.RunSynchronously |
|
let results = Assert.NotNull (test()) |
|
Check.Quick results |
|
|
|
[<Property>] |
|
let ``Request Text does not return a null when using a random gibberish level`` () = |
|
let test ()= |
|
Pancake.RequestTextAsync (ValidGibberishLevelInput()) 5 |
|
|> Async.RunSynchronously |
|
let results = Assert.NotNull (test()) |
|
Check.Quick results |
|
|
|
[<Property>] |
|
let ``Request Text does not return a null when using a random sentence count`` () = |
|
let test () = |
|
Pancake.RequestTextAsync 5 (ValidSentencesInput()) |
|
|> Async.RunSynchronously |
|
let results = Assert.NotNull test |
|
Check.Quick results |
|
|
|
[<Property>] |
|
let ``RequestTextFromFile does not return a null when using console-waterworks-info`` () = |
|
let test () = |
|
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) ConsoleWaterworks |
|
|> Async.RunSynchronously |
|
let results = Assert.NotNull (test()) |
|
Check.Quick results |
|
|
|
[<Property>] |
|
let ``RequestTextFromFile does not return a null when using desktop-clock-info`` () = |
|
let test ()= |
|
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) DesktopClock |
|
|> Async.RunSynchronously |
|
let results = Assert.NotNull (test()) |
|
Check.Quick results |
|
|
|
[<Property>] |
|
let ``RequestTextFromFile does not return a null when using word-generator`` () = |
|
let test () = |
|
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) WordGenerator |
|
|> Async.RunSynchronously |
|
let results = Assert.NotNull (test()) |
|
Check.Quick results |
|
|
|
[<Property>] |
|
let ``RequestTextFromFile does not return a null when using test-post`` () = |
|
let test () = |
|
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) TestPost |
|
|> Async.RunSynchronously |
|
let results = Assert.NotNull (test()) |
|
Check.Quick results |
|
|
|
[<Property>] |
|
let ``RequestAllTemplateFiles does not return a null`` () = |
|
let test () = |
|
Pancake.RequestAllTemplateFilesAsync () |
|
|> Async.RunSynchronously |
|
let results = Assert.NotNull (test()) |
|
Check.Quick results |
|
|
|
module ``Contents Test`` = |
|
|
|
[<Property>] |
|
let ``RequestRandomText returns a string which contains a full stop`` () = |
|
let test () = |
|
Pancake.RequestRandomTextAsync () |
|
|> Async.RunSynchronously |
|
let results = Assert.Contains(".", test()) |
|
Check.Quick results |
|
|
|
[<Property>] |
|
let ``RequestText returns a string which contains a full stop`` () = |
|
let test () = |
|
Pancake.RequestTextAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) |
|
|> Async.RunSynchronously |
|
let results = Assert.Contains(".", test()) |
|
Check.Quick results |
|
|
|
[<Property>] |
|
let ``RequestTextFromFile returns a string which contains a full stop when using console-waterworks-announcement`` () = |
|
let test () = |
|
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) ConsoleWaterworks |
|
|> Async.RunSynchronously |
|
let results = Assert.Contains(".", test()) |
|
Check.Quick results |
|
|
|
[<Property>] |
|
let ``RequestTextFromFile returns a string which contains a full stop when using desktop-clock-info`` () = |
|
let test () = |
|
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) DesktopClock |
|
|> Async.RunSynchronously |
|
let results = Assert.Contains(".", test()) |
|
Check.Quick results |
|
|
|
[<Property>] |
|
let ``RequestTextFromFile returns a string which contains a full stop when using test-post`` () = |
|
let test () = |
|
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) TestPost |
|
|> Async.RunSynchronously |
|
let results = Assert.Contains(".", test()) |
|
Check.Quick results |
|
|
|
[<Property>] |
|
let ``RequestTextFromFile returns a string which contains a full stop when using word-generator`` () = |
|
let test () = |
|
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) WordGenerator |
|
|> Async.RunSynchronously |
|
let results = Assert.Contains(".", test()) |
|
Check.Quick results |
|
|
|
[<Property>] |
|
let ``RequestRandomText returns a string which ends with a full stop`` () = |
|
let test () = |
|
Pancake.RequestRandomTextAsync () |
|
|> Async.RunSynchronously |
|
let results = Assert.EndsWith(".", test()) |
|
Check.Quick results |
|
|
|
[<Property>] |
|
let ``RequestTest returns a string which ends with a full stop`` () = |
|
let test () = |
|
Pancake.RequestTextAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) |
|
|> Async.RunSynchronously |
|
let results = Assert.EndsWith(".", test()) |
|
Check.Quick results |
|
|
|
[<Property>] |
|
let ``RequestTextFromFile returns a string which ends with a full stop when using console-waterwork-announcement`` () = |
|
let test () = |
|
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) ConsoleWaterworks |
|
|> Async.RunSynchronously |
|
let results = Assert.EndsWith(".", test()) |
|
Check.Quick results |
|
|
|
[<Property>] |
|
let ``RequestTextFromFile returns a string which ends with a full stop when using desktop-clock-info`` () = |
|
let test () = |
|
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) DesktopClock |
|
|> Async.RunSynchronously |
|
let results = Assert.EndsWith(".", test()) |
|
Check.Quick results |
|
|
|
[<Property>] |
|
let ``RequestTextFromFile returns a string which ends with a full stop when using test-post`` () = |
|
let test () = |
|
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) TestPost |
|
|> Async.RunSynchronously |
|
let results = Assert.EndsWith(".", test()) |
|
Check.Quick results |
|
|
|
[<Property>] |
|
let ``RequestTextFromFile returns a string which ends with a full stop when using word-generator`` () = |
|
let test () = |
|
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) WordGenerator |
|
|> Async.RunSynchronously |
|
let results = Assert.EndsWith(".", test()) |
|
Check.Quick results |
|
|
|
[<Property>] |
|
let ``RequestAllTemplateFiles does not return an empty list`` () = |
|
let test () = |
|
Pancake.RequestAllTemplateFilesAsync () |
|
|> Async.RunSynchronously |
|
let results = Assert.NotEmpty (test()) |
|
Check.Quick results |