Browse Source

Wrote CleanResult ends with end-token property test.

Odd bit of code cleaning (comments, unneeded brackets Etc.)
master
Craig Oates 6 years ago
parent
commit
079f717bed
  1. 12
      TestCentre/PropertyTests.fs
  2. 4
      TestCentre/UnitTests.fs
  3. 2
      WetPancake/DataCleaning.fs

12
TestCentre/PropertyTests.fs

@ -11,9 +11,9 @@
(* End of Session Note - Monday 23rd July
==================================================================================================================
[] Remove the "contains a full stop" tests -- no longer needed due to change in functionality.
[x] Remove the "contains a full stop" tests -- no longer needed due to change in functionality.
[] Update the "end with a full-stop" tests -- expanded the way a sentence can end.
[] Double check UnitTests.fs
[x] Double check UnitTests.fs
*)
module ``Null Tests`` =
@ -103,6 +103,14 @@
let results () = Assert.Equal(desiredSentencesCount , test())
Check.Quick (results())
[<Property>]
let ``CleanResult returns a string which ends with the correct end-token`` () =
let test () =
Pancake.CleanResultAsync (DefaultSentenceCount()) DefaultTestSentence
|> Async.RunSynchronously
|> EndsAsIntended
let results () = Assert.True(test())
Check.Quick (results())
[<Property>]
let ``RequestAllTemplateFiles does not return an empty list`` () =

4
TestCentre/UnitTests.fs

@ -114,11 +114,11 @@
[<Fact>]
let ``CleanResult returns a string which ends with the correct end-token`` () =
let result () =
let result =
Pancake.CleanResultAsync (DefaultSentenceCount()) DefaultTestSentence
|> Async.RunSynchronously
|> EndsAsIntended
Assert.True(result())
Assert.True(result)
[<Fact>]
let ``CleanResult returns intended number of sentences`` () =

2
WetPancake/DataCleaning.fs

@ -6,4 +6,4 @@
let SplitText pattern text = Regex.Split(text, pattern)
let TrimEnd charArray (text: string) = text.TrimEnd charArray //[|' '|]
let TrimEnd charArray (text: string) = text.TrimEnd charArray
Loading…
Cancel
Save