Browse Source

Cleaned up the Test Centre code.

master
Craig Oates 6 years ago
parent
commit
36c564142e
  1. 8
      TestCentre/PropertyTests.fs
  2. 4
      TestCentre/TestingConstants.fs
  3. 19
      TestCentre/UnitTests.fs

8
TestCentre/PropertyTests.fs

@ -12,12 +12,6 @@
let results = Assert.NotNull test
Check.Quick results
[<Property>]
let ``TEMP Request Random Text does not return null when using the built-in random settings`` () =
let test = Pancake.RequestRandomText
let results = Assert.NotNull test
Check.Quick results
[<Property>]
let ``Request Text does not return null when using fixed input parameters`` () =
let gibberishLevel = System.Random().Next(2, 10)
@ -29,7 +23,7 @@
[<Property>]
let ``Request Text does not return null when using a random gibberish level`` () =
let gibberishLevel = System.Random().Next(2, 10)
let test = Pancake.RequestText 5 10
let test = Pancake.RequestText gibberishLevel 10
let results = Assert.NotNull test
Check.Quick results

4
TestCentre/TestingConstants.fs

@ -1,4 +1,6 @@
module TestingConstants
module internal TestingConstants
// Use these to reference the built-in .txt files in Test Centre.
[<Literal>]
let DesktopClock = __SOURCE_DIRECTORY__ + @"\TextFiles\desktop-clock-info.txt"

19
TestCentre/UnitTests.fs

@ -5,9 +5,10 @@
open TestingConstants
open System.IO
(*These tests check to see if the .txt files exists in theTest Centre project.
The Wet Pancake library does not expose the file accessfunctions so the .txt files are mirrored here (in Text Centre).
The mirroring, also, doubles up as sample files to pass intoWet Pancake.*)
(* 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. *)
[<Fact>]
let ``desktop-clock-info can be found`` () =
let result = File.Exists DesktopClock
@ -29,40 +30,40 @@
Assert.Equal(true, result)
[<Fact>]
let ``Request Random Text does not return a null`` () =
let ``RequestRandomText does not return a null`` () =
let result = Pancake.RequestRandomText
Assert.NotNull result
[<Fact>]
let ``Request Text does not return a null`` () =
let ``RequestText does not return a null`` () =
let gibberishLevel = System.Random().Next(2, 20)
let totalSentences = System.Random().Next(2, 20)
let result () = Pancake.RequestText gibberishLevel totalSentences
Assert.NotNull result
[<Fact>]
let ``Request Text From File does not return a null for desktop-clock-info`` () =
let ``RequestTextFromFile does not return a null when using desktop-clock-info`` () =
let gibberishLevel = System.Random().Next(2, 20)
let totalSentences = System.Random().Next(2, 20)
let result = Pancake.RequestTextFromFile gibberishLevel totalSentences DesktopClock
Assert.NotNull result
[<Fact>]
let ``Request Text From File does not return a null for console-waterworks-announcement`` () =
let ``RequestTextFromFile does not return a null when using console-waterworks-announcement`` () =
let gibberishLevel = System.Random().Next(2, 20)
let totalSentences = System.Random().Next(2, 20)
let result = Pancake.RequestTextFromFile gibberishLevel totalSentences ConsoleWaterworks
Assert.NotNull result
[<Fact>]
let ``Request Text From File does not return a null for word-generator`` () =
let ``RequestTextFromFile does not return a null when using word-generator`` () =
let gibberishLevel = System.Random().Next(2, 20)
let totalSentences = System.Random().Next(2, 20)
let result = Pancake.RequestTextFromFile gibberishLevel totalSentences WordGenerator
Assert.NotNull result
[<Fact>]
let ``Request Test From File does not generate a null for test-post`` () =
let ``RequestTestFromFile does not generate a null when using test-post`` () =
let gibberishLevel = System.Random().Next(2, 20)
let totalSentences = System.Random().Next(2, 20)
let result = Pancake.RequestTextFromFile gibberishLevel totalSentences TestPost

Loading…
Cancel
Save