Browse Source

Added contents tests in unit tests.

master
Craig Oates 6 years ago
parent
commit
ba8f40f41f
  1. 60
      TestCentre/UnitTests.fs

60
TestCentre/UnitTests.fs

@ -32,6 +32,7 @@
Assert.Equal(true, result)
module ``Null Tests`` =
[<Fact>]
let ``RequestRandomText does not return a null`` () =
let result = Pancake.RequestRandomTextAsync ()
@ -90,6 +91,15 @@
|> Async.RunSynchronously
Assert.Contains(".", result)
[<Fact>]
let ``RequestTextFromFile returns a string which contains a full stop when using console-waterworks-announcement`` () =
let gibberishLevel = System.Random().Next(2, 20)
let totalSentences = System.Random().Next(2, 20)
let result =
Pancake.RequestTextFromFileAsync gibberishLevel totalSentences ConsoleWaterworks
|> Async.RunSynchronously
Assert.Contains(".", result)
[<Fact>]
let ``RequestTextFromFile returns a string which contains a full stop when using desktop-clock-info`` () =
let gibberishLevel = System.Random().Next(2, 20)
@ -100,11 +110,11 @@
Assert.Contains(".", result)
[<Fact>]
let ``RequestTextFromFile returns a string which contains a full stop when using console-waterworks-announcement`` () =
let ``RequestTextFromFile returns a string which contains a full stop when using test-post`` () =
let gibberishLevel = System.Random().Next(2, 20)
let totalSentences = System.Random().Next(2, 20)
let result =
Pancake.RequestTextFromFileAsync gibberishLevel totalSentences ConsoleWaterworks
Pancake.RequestTextFromFileAsync gibberishLevel totalSentences TestPost
|> Async.RunSynchronously
Assert.Contains(".", result)
@ -117,12 +127,54 @@
|> 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 ``RequestTextFromFile returns a string which contains a full stop using test-post`` () =
let ``RequestText returns a string which ends with a full stop`` () =
let gibberishLevel = System.Random().Next(2, 20)
let totalSentences = System.Random().Next(2, 20)
let result =
Pancake.RequestTextAsync gibberishLevel totalSentences
|> Async.RunSynchronously
Assert.EndsWith(".", result)
[<Fact>]
let ``RequestTextFromFile returns a string which ends with a full stop when using console-waterworks-announcement`` () =
let gibberishLevel = System.Random().Next(2, 20)
let totalSentences = System.Random().Next(2, 20)
let result =
Pancake.RequestTextFromFileAsync gibberishLevel totalSentences ConsoleWaterworks
|> Async.RunSynchronously
Assert.EndsWith(".", result)
[<Fact>]
let ``RequestTextFromFile returns a sting which ends with a full stop when using desktop-clock-info`` () =
let gibberishLevel = System.Random().Next(2, 20)
let totalSentences = System.Random().Next(2, 20)
let result =
Pancake.RequestTextFromFileAsync gibberishLevel totalSentences DesktopClock
|> Async.RunSynchronously
Assert.EndsWith(".", result)
[<Fact>]
let ``RequestTextFromFile returns a sting which ends with a full stop when using test-post`` () =
let gibberishLevel = System.Random().Next(2, 20)
let totalSentences = System.Random().Next(2, 20)
let result =
Pancake.RequestTextFromFileAsync gibberishLevel totalSentences TestPost
|> Async.RunSynchronously
Assert.Contains(".", result)
Assert.EndsWith(".", result)
[<Fact>]
let ``RequestTextFromFile returns a sting which ends with a full stop when using word-generator`` () =
let gibberishLevel = System.Random().Next(2, 20)
let totalSentences = System.Random().Next(2, 20)
let result =
Pancake.RequestTextFromFileAsync gibberishLevel totalSentences WordGenerator
|> Async.RunSynchronously
Assert.EndsWith(".", result)
Loading…
Cancel
Save