Browse Source

Got first property test working.

The Visual Studio runner for XUnit is detecting the FsCheck test and displaying it test explorer, as well.
master
Craig Oates 6 years ago
parent
commit
e35fbec443
  1. 10
      TestCentre/PropertyTests.fs
  2. 121
      TestCentre/UnitTests.fs

10
TestCentre/PropertyTests.fs

@ -1,2 +1,12 @@
module PropertyTests
open FsCheck
open global.Xunit
open FsCheck.Xunit
open WetPancake
[<Property>]
let ``Request Random Text consistently produces a valid output`` () =
let ProduceResult =
Assert.NotNull (Pancake.RequestRandomText)
Check.Quick ProduceResult

121
TestCentre/UnitTests.fs

@ -1,62 +1,59 @@
namespace TestCentre
module ``Unit Tests`` =
open Xunit
open WetPancake
open TestingConstants
open System.IO
(*These tests check to see if the .txt files exists in the Test Centre project.
The Wet Pancake library does not expose the file access functions so the .txt
files are mirrored here (in Text Centre)
The mirroring, also, doubles up as sample files to pass into Wet Pancake.*)
[<Fact>]
let ``desktop-clock-info-txt can be found`` () =
let result = File.Exists DesktopClock
Assert.Equal(true, result);
[<Fact>]
let ``console-waterworks-announcements-txt can be found`` () =
let result = File.Exists ConsoleWaterworks
Assert.Equal(true, result);
[<Fact>]
let ``word-generator-txt can be found`` () =
let result = File.Exists WordGenerator
Assert.Equal(true, result);
[<Fact>]
let ``test-post-txt can be found`` () =
let result = File.Exists TestPost
Assert.Equal(true, result)
[<Fact>]
let ``Request Random Text does not generate a null`` () =
let result = Pancake.RequestRandomText
Assert.NotNull result
[<Fact>]
let ``Request Text does not generate a null`` () =
let result = Pancake.RequestText 5 5
Assert.NotNull result
[<Fact>]
let ``Request Text From File does not generate a null for desktop-clock-info-txt`` () =
let result = Pancake.RequestTextFromFile 5 5 DesktopClock
Assert.NotNull result
[<Fact>]
let ``Request Text From File does not generate a null for console-waterworks-announcement-txt`` () =
let result = Pancake.RequestTextFromFile 5 5 ConsoleWaterworks
Assert.NotNull result
[<Fact>]
let ``Request Text From File does not generate a null for word-generator-txt`` () =
let result = Pancake.RequestTextFromFile 5 5 WordGenerator
Assert.NotNull result
[<Fact>]
let ``Request Test From File does not generate a null for test-post-txt``() =
let result = Pancake.RequestTextFromFile 5 5 TestPost
Assert.NotNull result
module ``Unit Tests``
open Xunit
open WetPancake
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.*)
[<Fact>]
let ``desktop-clock-info-txt can be found`` () =
let result = File.Exists DesktopClock
Assert.Equal(true, result);
[<Fact>]
let ``console-waterworks-announcements-txt can be found`` () =
let result = File.Exists ConsoleWaterworks
Assert.Equal(true, result);
[<Fact>]
let ``word-generator-txt can be found`` () =
let result = File.Exists WordGenerator
Assert.Equal(true, result);
[<Fact>]
let ``test-post-txt can be found`` () =
let result = File.Exists TestPost
Assert.Equal(true, result)
[<Fact>]
let ``Request Random Text does not generate a null`` () =
let result = Pancake.RequestRandomText
Assert.NotNull result
[<Fact>]
let ``Request Text does not generate a null`` () =
let result = Pancake.RequestText 5 5
Assert.NotNull result
[<Fact>]
let ``Request Text From File does not generate a null fordesktop- clock- info-txt`` () =
let result = Pancake.RequestTextFromFile 5 5 DesktopClock
Assert.NotNull result
[<Fact>]
let ``Request Text From File does not generate a null forconsole- waterworks-announcement-txt`` () =
let result = Pancake.RequestTextFromFile 5 5 ConsoleWaterworks
Assert.NotNull result
[<Fact>]
let ``Request Text From File does not generate a null forword- generator- txt`` () =
let result = Pancake.RequestTextFromFile 5 5 WordGenerator
Assert.NotNull result
[<Fact>]
let ``Request Test From File does not generate a null fortest- post-txt`` () =
let result = Pancake.RequestTextFromFile 5 5 TestPost
Assert.NotNull result
Loading…
Cancel
Save