|
|
|
@ -127,12 +127,12 @@
|
|
|
|
|
|> Array.length |
|
|
|
|
(count - 1) // Split creates an extra (empty) item at end. |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``CleanResult returns a string with a full stop`` () = |
|
|
|
|
let result = |
|
|
|
|
Pancake.CleanResult (DefaultSentenceCount()) DefaultTestSentence |
|
|
|
|
|> Async.RunSynchronously |
|
|
|
|
Assert.Contains(".", result) |
|
|
|
|
let private endsAsIntended (text: string) = |
|
|
|
|
match text.Chars (text.Length - 1) with |
|
|
|
|
| '.' -> true |
|
|
|
|
| '!' -> true |
|
|
|
|
| '?' -> true |
|
|
|
|
| _ -> false |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``CleanResult returns intended number of sentences`` () = |
|
|
|
@ -196,60 +196,20 @@
|
|
|
|
|
Assert.Equal(desiredSentencesCount, result) |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestRandomText returns a string which contains a full stop`` () = |
|
|
|
|
let ``RequestRandomText returns a string which ends with the correct end-token`` () = |
|
|
|
|
let result = |
|
|
|
|
Pancake.RequestRandomTextAsync () |
|
|
|
|
|> Async.RunSynchronously |
|
|
|
|
Assert.Contains(".", result) |
|
|
|
|
|> endsAsIntended |
|
|
|
|
Assert.True(result) |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestText returns a string which contains a full stop`` () = |
|
|
|
|
let ``RequestText returns a string which ends with the correct end-token`` () = |
|
|
|
|
let result = |
|
|
|
|
Pancake.RequestTextAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) |
|
|
|
|
|> Async.RunSynchronously |
|
|
|
|
Assert.Contains(".", result) |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestTextFromFile returns a string which contains a full stop when using console-waterworks-announcement`` () = |
|
|
|
|
let result = |
|
|
|
|
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) ConsoleWaterworks |
|
|
|
|
|> Async.RunSynchronously |
|
|
|
|
Assert.Contains(".", result) |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestTextFromFile returns a string which contains a full stop when using desktop-clock-info`` () = |
|
|
|
|
let result = |
|
|
|
|
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) DesktopClock |
|
|
|
|
|> Async.RunSynchronously |
|
|
|
|
Assert.Contains(".", result) |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestTextFromFile returns a string which contains a full stop when using test-post`` () = |
|
|
|
|
let result = |
|
|
|
|
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) TestPost |
|
|
|
|
|> Async.RunSynchronously |
|
|
|
|
Assert.Contains(".", result) |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestTextFromFile returns a string which contains a full stop when using word-generator`` () = |
|
|
|
|
let result = |
|
|
|
|
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) WordGenerator |
|
|
|
|
|> Async.RunSynchronously |
|
|
|
|
Assert.Contains(".", result) |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestRandomText returns a string which ends with a full stop`` () = |
|
|
|
|
let result = |
|
|
|
|
Pancake.RequestRandomTextAsync () |
|
|
|
|
|> Async.RunSynchronously |
|
|
|
|
Assert.EndsWith(".", result) |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestText returns a string which ends with a full stop`` () = |
|
|
|
|
let result = |
|
|
|
|
Pancake.RequestTextAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) |
|
|
|
|
|> Async.RunSynchronously |
|
|
|
|
Assert.EndsWith(".", result) |
|
|
|
|
|> endsAsIntended |
|
|
|
|
Assert.True(result) |
|
|
|
|
|
|
|
|
|
[<Fact>] |
|
|
|
|
let ``RequestTextFromFile returns a string which ends with a full stop when using console-waterworks-announcement`` () = |
|
|
|
|