12 changed files with 259 additions and 79 deletions
@ -0,0 +1,73 @@
|
||||
module PropertyTests |
||||
|
||||
open FsCheck |
||||
open global.Xunit |
||||
open FsCheck.Xunit |
||||
open WetPancake |
||||
open TestingConstants |
||||
|
||||
[<Property>] |
||||
let ``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 ``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) |
||||
let totalSentences = System.Random().Next(2, 10) |
||||
let test = Pancake.RequestText gibberishLevel totalSentences |
||||
let results = Assert.NotNull test |
||||
Check.Quick results |
||||
|
||||
[<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 results = Assert.NotNull test |
||||
Check.Quick results |
||||
|
||||
[<Property>] |
||||
let ``Request Text does not return null when using a random sentence count`` () = |
||||
let totalSentences = System.Random().Next(2, 10) |
||||
let test () = Pancake.RequestText 5 totalSentences |
||||
let results () = Assert.NotNull test |
||||
Check.Quick results |
||||
|
||||
[<Property>] |
||||
let ``Using desktop-clock-info does not return null`` () = |
||||
let gibberishLevel = System.Random().Next(2, 10) |
||||
let totalSentences = System.Random().Next(2, 10) |
||||
let test = Pancake.RequestTextFromFile gibberishLevel totalSentences DesktopClock |
||||
let results = Assert.NotNull test |
||||
Check.Quick results |
||||
|
||||
[<Property>] |
||||
let ``Using console-waterworks-announcement does not return null`` () = |
||||
let gibberishLevel = System.Random().Next(2, 10) |
||||
let totalSentences = System.Random().Next(2, 10) |
||||
let test = Pancake.RequestTextFromFile gibberishLevel totalSentences ConsoleWaterworks |
||||
let results = Assert.NotNull test |
||||
Check.Quick results |
||||
|
||||
[<Property>] |
||||
let ``Using word-generator does not return null`` () = |
||||
let gibberishLevel = System.Random().Next(2, 10) |
||||
let totalSentences = System.Random().Next(2, 10) |
||||
let test = Pancake.RequestTextFromFile gibberishLevel totalSentences WordGenerator |
||||
let results = Assert.NotNull test |
||||
Check.Quick results |
||||
|
||||
[<Property>] |
||||
let ``Using test-post does not return null`` () = |
||||
let gibberishLevel = System.Random().Next(2, 10) |
||||
let totalSentences = System.Random().Next(2, 10) |
||||
let test = Pancake.RequestTextFromFile gibberishLevel totalSentences TestPost |
||||
let results = Assert.NotNull test |
||||
Check.Quick results |
@ -0,0 +1,13 @@
|
||||
This is a test post for testing inner-page navigation, in the Writing section. Please ignore this post. It is only here for testing purposes. You are free to continue reading if you want but I can assure you no manner of meaningful meaning will arrive. |
||||
|
||||
This is a piece of writing, which offers you nothing in return for your time spent reading it. This is selfish, in many ways, and the piece should show remorse or even shame. But, as you might have guessed, a piece of writing does not have feelings. Imagine if it did, though. Think of all the bizarre situations you would partake in. What a magical mind-quest you could have... |
||||
|
||||
I see you have continued on this path to nothingness... How would you like this to end? I am at a lost so please tell me. Oh, wait... I, the writer or is it waiter? have written this at a time when you were not present. So, you have no way of communicating your goals with me -- that is a pity. Seeing as I do not know how you would like me to conclude this moment, I will fall-back to the truth -- yet again. There is no meaning here. |
||||
|
||||
Wow, you really are sticking around, aren't you? Hmm... okay... I guess I should make you take your shoes off and offer you a brew. Come on then! Let's be 'avin' yea! Come in! Come in! Let's get down and dirty in the minutiae... |
||||
|
||||
Let me begin by offering you a sincere "Hello and how are you today?" I hope the weather is nice when and where you are. There is something about it which can make or break a day. The tussle between working with and against it can leave a mark on the soul. But, there is a certain type of comfort to be had when you acknowledge it will always win against the human race. Jammy dodger? Would you like sugar in your tea? |
||||
|
||||
Is that the doorbell? Excuse me, I'm just going to see whom it is -- or is it who? |
||||
|
||||
... |
@ -1,53 +1,69 @@
|
||||
namespace TestCentre |
||||
module ``Unit Tests`` |
||||
|
||||
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 ``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 |
||||
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 |
@ -1,23 +1,23 @@
|
||||
module internal SystemServices |
||||
|
||||
open System |
||||
open System.Collections.Generic |
||||
|
||||
let PickRandomNumber min max = Random().Next(min, max); |
||||
let PickRandomNumber min max = Random().Next(min, max) |
||||
|
||||
let PickRandomItem seq = |
||||
(* This if check equates to an empty sequence. |
||||
The program cannot continue at this point. |
||||
Need a better way to handle this error. |
||||
Need a way to give a reasonable "default value" back. *) |
||||
if (Seq.length seq) = 0 then |
||||
seq |> Seq.item 0 |
||||
else |
||||
let index = Random().Next(0, Seq.length seq); |
||||
let index = PickRandomNumber 1 (Seq.length seq) |
||||
seq |> Seq.item index |
||||
|
||||
(* The if-check is used as a fallback. |
||||
The "." is used to signifiy the end of a sentence. |
||||
This return is picked up in the system, |
||||
in the GenerateMarkovChain function. *) |
||||
let PickNextWord seq = |
||||
if (Seq.length seq) = 0 then |
||||
"." |
||||
else |
||||
let index = Random().Next(0, Seq.length seq); |
||||
seq |> Seq.item index |
||||
let index = PickRandomNumber 0 (Seq.length seq) |
||||
seq |> Seq.item index |
||||
|
||||
let PickStartWords seq = 0 |
@ -0,0 +1,13 @@
|
||||
This is a test post for testing inner-page navigation, in the Writing section. Please ignore this post. It is only here for testing purposes. You are free to continue reading if you want but I can assure you no manner of meaningful meaning will arrive. |
||||
|
||||
This is a piece of writing, which offers you nothing in return for your time spent reading it. This is selfish, in many ways, and the piece should show remorse or even shame. But, as you might have guessed, a piece of writing does not have feelings. Imagine if it did, though. Think of all the bizarre situations you would partake in. What a magical mind-quest you could have... |
||||
|
||||
I see you have continued on this path to nothingness... How would you like this to end? I am at a lost so please tell me. Oh, wait... I, the writer or is it waiter? have written this at a time when you were not present. So, you have no way of communicating your goals with me -- that is a pity. Seeing as I do not know how you would like me to conclude this moment, I will fall-back to the truth -- yet again. There is no meaning here. |
||||
|
||||
Wow, you really are sticking around, aren't you? Hmm... okay... I guess I should make you take your shoes off and offer you a brew. Come on then! Let's be 'avin' yea! Come in! Come in! Let's get down and dirty in the minutiae... |
||||
|
||||
Let me begin by offering you a sincere "Hello and how are you today?" I hope the weather is nice when and where you are. There is something about it which can make or break a day. The tussle between working with and against it can leave a mark on the soul. But, there is a certain type of comfort to be had when you acknowledge it will always win against the human race. Jammy dodger? Would you like sugar in your tea? |
||||
|
||||
Is that the doorbell? Excuse me, I'm just going to see whom it is -- or is it who? |
||||
|
||||
... |
Loading…
Reference in new issue