The purpose of this repository is to provide a way for people to generate random "placeholder text" -- with a Markov Chain. https://www.craigoates.net/Software/project/12
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.7 KiB

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 can be found`` () =
let result = File.Exists DesktopClock
Assert.Equal(true, result);
[<Fact>]
let ``console-waterworks-announcements can be found`` () =
let result = File.Exists ConsoleWaterworks
Assert.Equal(true, result);
[<Fact>]
let ``word-generator can be found`` () =
let result = File.Exists WordGenerator
Assert.Equal(true, result);
[<Fact>]
let ``test-post can be found`` () =
let result = File.Exists TestPost
Assert.Equal(true, result)
[<Fact>]
let ``Request Random Text does not return a null`` () =
let result = Pancake.RequestRandomText
Assert.NotNull result
[<Fact>]
let ``Request Text 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 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 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 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 gibberishLevel = System.Random().Next(2, 20)
let totalSentences = System.Random().Next(2, 20)
let result = Pancake.RequestTextFromFile gibberishLevel totalSentences TestPost
Assert.NotNull result