|
|
|
@ -3,6 +3,7 @@
|
|
|
|
|
open Xunit |
|
|
|
|
open WetPancake |
|
|
|
|
open TestingConstants |
|
|
|
|
open System |
|
|
|
|
open System.IO |
|
|
|
|
open InputGeneration |
|
|
|
|
|
|
|
|
@ -35,82 +36,99 @@
|
|
|
|
|
module ``Null Tests`` = |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestRandomText does not return a null`` () = |
|
|
|
|
let result = Pancake.RequestRandomTextAsync () |
|
|
|
|
let ``CleanResult does not return a null`` () = |
|
|
|
|
let text = "This is a sentence. And, so is this. This shouldn't be here! How about this? No!" |
|
|
|
|
let result = Pancake.CleanResult (Random().Next(1, 6)) text |
|
|
|
|
Assert.NotNull result |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestText does not return a null`` () = |
|
|
|
|
let result () = Pancake.RequestTextAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) |
|
|
|
|
let ``RequestAllTemplateFiles does not generate a null`` () = |
|
|
|
|
let result = Pancake.RequestAllTemplateFilesAsync () |
|
|
|
|
Assert.NotNull result |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestTextFromFile does not return a null when using desktop-clock-info`` () = |
|
|
|
|
let result = |
|
|
|
|
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) DesktopClock |
|
|
|
|
let ``RequestCleanText does not return a null`` () = |
|
|
|
|
let result = Pancake.RequestCleanTextAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) |
|
|
|
|
Assert.NotNull result |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestTextFromFile does not return a null when using console-waterworks-announcement`` () = |
|
|
|
|
let ``RequestCleanTextFromFile does not return a null when using console-waterworks-announcement`` () = |
|
|
|
|
let result = |
|
|
|
|
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) ConsoleWaterworks |
|
|
|
|
Pancake.RequestCleanTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) ConsoleWaterworks |
|
|
|
|
Assert.NotNull result |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestTextFromFile does not return a null when using word-generator`` () = |
|
|
|
|
let ``RequestCleanTextFromFile does not return a null when using desktop-clock-info`` () = |
|
|
|
|
let result = |
|
|
|
|
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) WordGenerator |
|
|
|
|
Pancake.RequestCleanTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) DesktopClock |
|
|
|
|
Assert.NotNull result |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestTestFromFile does not generate a null when using test-post`` () = |
|
|
|
|
let ``RequestCleanTextFromFile does not return a null when using test-post`` () = |
|
|
|
|
let result = |
|
|
|
|
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) TestPost |
|
|
|
|
Pancake.RequestCleanTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) TestPost |
|
|
|
|
Assert.NotNull result |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestAllTemplateFiles does not generate a null`` () = |
|
|
|
|
let result = Pancake.RequestAllTemplateFilesAsync () |
|
|
|
|
let ``RequestCleanTextFromFile does not return a null when using word-generator`` () = |
|
|
|
|
let result = |
|
|
|
|
Pancake.RequestCleanTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) WordGenerator |
|
|
|
|
Assert.NotNull result |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``CleanResult does not return a null`` () = |
|
|
|
|
let text = "This is a sentence. And, so is this. This shouldn't be here! How about this? No!" |
|
|
|
|
let result = Pancake.CleanResult (ValidGibberishLevelInput()) text |
|
|
|
|
let ``RequestRandomText does not return a null`` () = |
|
|
|
|
let result = Pancake.RequestRandomTextAsync () |
|
|
|
|
Assert.NotNull result |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestCleanText does not return a null`` () = |
|
|
|
|
let result = Pancake.RequestCleanTextAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) |
|
|
|
|
let ``RequestText does not return a null`` () = |
|
|
|
|
let result () = Pancake.RequestTextAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) |
|
|
|
|
Assert.NotNull result |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestCleanTextFromFile does not return a null when using console-waterworks-announcement`` () = |
|
|
|
|
let ``RequestTextFromFile does not return a null when using desktop-clock-info`` () = |
|
|
|
|
let result = |
|
|
|
|
Pancake.RequestCleanTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) ConsoleWaterworks |
|
|
|
|
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) DesktopClock |
|
|
|
|
Assert.NotNull result |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestCleanTextFromFile does not return a null when using desktop-clock-info`` () = |
|
|
|
|
let ``RequestTextFromFile does not return a null when using console-waterworks-announcement`` () = |
|
|
|
|
let result = |
|
|
|
|
Pancake.RequestCleanTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) DesktopClock |
|
|
|
|
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) ConsoleWaterworks |
|
|
|
|
Assert.NotNull result |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestCleanTextFromFile does not return a null when using test-post`` () = |
|
|
|
|
let ``RequestTextFromFile does not return a null when using word-generator`` () = |
|
|
|
|
let result = |
|
|
|
|
Pancake.RequestCleanTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) TestPost |
|
|
|
|
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) WordGenerator |
|
|
|
|
Assert.NotNull result |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestCleanTextFromFile does not return a null when using word-generator`` () = |
|
|
|
|
let ``RequestTestFromFile does not generate a null when using test-post`` () = |
|
|
|
|
let result = |
|
|
|
|
Pancake.RequestCleanTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) WordGenerator |
|
|
|
|
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) TestPost |
|
|
|
|
Assert.NotNull result |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
module ``Contents Tests`` = |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``CleanResult returns a string with a full stop`` () = |
|
|
|
|
let text = "This is a sentence. And, so is this. This shouldn't be here! How about this? No!" |
|
|
|
|
let result = |
|
|
|
|
Pancake.CleanResult (Random().Next(1, 6)) text |
|
|
|
|
|> Async.RunSynchronously |
|
|
|
|
Assert.Contains(".", result) |
|
|
|
|
|
|
|
|
|
// YOU ARE HERE... |
|
|
|
|
// - ADD TESTS FOR "CLEANING" FUNCTIONS |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestAllTemplateFiles does not return an empty list`` () = |
|
|
|
|
let result = |
|
|
|
|
Pancake.RequestAllTemplateFilesAsync () |
|
|
|
|
|> Async.RunSynchronously |
|
|
|
|
Assert.NotEmpty result |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestRandomText returns a string which contains a full stop`` () = |
|
|
|
|
let result = |
|
|
|
@ -193,11 +211,4 @@
|
|
|
|
|
let result = |
|
|
|
|
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) WordGenerator |
|
|
|
|
|> Async.RunSynchronously |
|
|
|
|
Assert.EndsWith(".", result) |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestAllTemplateFiles does not return an empty list`` () = |
|
|
|
|
let result = |
|
|
|
|
Pancake.RequestAllTemplateFilesAsync () |
|
|
|
|
|> Async.RunSynchronously |
|
|
|
|
Assert.NotEmpty result |
|
|
|
|
Assert.EndsWith(".", result) |