@ -3,8 +3,10 @@
open X u n i t
open W e t P a n c a k e
open T e s t i n g C o n s t a n t s
open S y s t e m
open S y s t e m . I O
open I n p u t G e n e r a t i o n
open H e l p e r s
module ``File Access Tests`` =
@ -34,6 +36,46 @@
module ``Null Tests`` =
[ < F a c t > ]
let ``CleanResult does not return a null`` () =
let text = "This is a sentence. And, so is this. This shouldn't be here! How about this? N o ! "
let result = Pancake.CleanResultAsync (Random().Next(1, 6 )) t e x t
Assert.NotNull r e s u l t
[ < F a c t > ]
let ``RequestAllTemplateFiles does not generate a null`` () =
let result = Pancake.RequestAllTemplateFilesAsync ( )
Assert.NotNull r e s u l t
[ < F a c t > ]
let ``RequestCleanText does not return a null`` () =
let result = Pancake.RequestCleanTextAsync (ValidGibberishLevelInput()) ( V a l i d S e n t e n c e s I n p u t ( ) )
Assert.NotNull r e s u l t
[ < F a c t > ]
let ``RequestCleanTextFromFile does not return a null when using console-waterworks-announcement`` () =
let result =
Pancake.RequestCleanTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) C o n s o l e W a t e r w o r k s
Assert.NotNull r e s u l t
[ < F a c t > ]
let ``RequestCleanTextFromFile does not return a null when using desktop-clock-info`` () =
let result =
Pancake.RequestCleanTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) D e s k t o p C l o c k
Assert.NotNull r e s u l t
[ < F a c t > ]
let ``RequestCleanTextFromFile does not return a null when using test-post`` () =
let result =
Pancake.RequestCleanTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) T e s t P o s t
Assert.NotNull r e s u l t
[ < F a c t > ]
let ``RequestCleanTextFromFile does not return a null when using word-generator`` () =
let result =
Pancake.RequestCleanTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) W o r d G e n e r a t o r
Assert.NotNull r e s u l t
[ < F a c t > ]
let ``RequestRandomText does not return a null`` () =
let result = Pancake.RequestRandomTextAsync ( )
@ -46,118 +88,183 @@
[ < F a c t > ]
let ``RequestTextFromFile does not return a null when using desktop-clock-info`` () =
let result = Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) D e s k t o p C l o c k
let result =
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) D e s k t o p C l o c k
Assert.NotNull r e s u l t
[ < F a c t > ]
let ``RequestTextFromFile does not return a null when using console-waterworks-announcement`` () =
let result = Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) C o n s o l e W a t e r w o r k s
let result =
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) C o n s o l e W a t e r w o r k s
Assert.NotNull r e s u l t
[ < F a c t > ]
let ``RequestTextFromFile does not return a null when using word-generator`` () =
let result = Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) W o r d G e n e r a t o r
let result =
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) W o r d G e n e r a t o r
Assert.NotNull r e s u l t
[ < F a c t > ]
let ``RequestTestFromFile does not generate a null when using test-post`` () =
let result = Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) T e s t P o s t
let result =
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) T e s t P o s t
Assert.NotNull r e s u l t
module ``Contents Tests`` =
[ < F a c t > ]
let ``RequestAllTemplateFiles does not generate a null`` () =
let result = Pancake.RequestAllTemplateFilesAsync ( )
Assert.NotNull r e s u l t
let ``CleanResult returns a string which ends with the correct end-token`` () =
let result =
Pancake.CleanResultAsync (DefaultSentenceCount()) D e f a u l t T e s t S e n t e n c e
|> A s y n c . R u n S y n c h r o n o u s l y
|> E n d s A s I n t e n d e d
A s s e r t . T r u e ( r e s u l t )
module ``Contents Tests`` =
[ < F a c t > ]
let ``CleanResult returns intended number of sentences`` () =
let desiredSentencesCount = ( D e f a u l t S e n t e n c e C o u n t ( ) )
let result =
Pancake.CleanResultAsync desiredSentencesCount D e f a u l t T e s t S e n t e n c e
|> A s y n c . R u n S y n c h r o n o u s l y
|> C o u n t S e n t e n c e s
Assert.Equal(desiredSentencesCount, r e s u l t )
[ < F a c t > ]
let ``RequestRandomText returns a string which contains a full stop`` () =
let ``RequestAllTemplateFiles does not return an empty list `` () =
let result =
Pancake.RequestRandomTextAsync ( )
Pancake.RequestAllTemplateFiles Async ( )
|> A s y n c . R u n S y n c h r o n o u s l y
Assert.Contains(".", r e s u l t )
Assert.NotEmpty r e s u l t
[ < F a c t > ]
let ``RequestText returns a string which contains a full stop `` () =
let ``RequestClean Text returns a string which ends with the correct end-token `` () =
let result =
Pancake.RequestTextAsync (ValidGibberishLevelInput()) ( V a l i d S e n t e n c e s I n p u t ( ) )
Pancake.RequestClean TextAsync (ValidGibberishLevelInput()) ( V a l i d S e n t e n c e s I n p u t ( ) )
|> A s y n c . R u n S y n c h r o n o u s l y
Assert.Contains(".", r e s u l t )
|> E n d s A s I n t e n d e d
A s s e r t . T r u e ( r e s u l t )
[ < F a c t > ]
let ``RequestTextFromFile returns a string which contains a full stop when using console-waterworks-announcement`` () =
let ``RequestCleanText returns intended number of sentences`` () =
let desiredSentencesCount = ( V a l i d S e n t e n c e s I n p u t ( ) )
let result =
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) C o n s o l e W a t e r w o r k s
Pancake.RequestCleanTextAsync (ValidGibberishLevelInput()) d e s i r e d S e n t e n c e s C o u n t
|> Async.RunSynchronously
|> C o u n t S e n t e n c e s
Assert.Equal(desiredSentencesCount, r e s u l t )
[ < F a c t > ]
let ``RequestCleanTextFromFile returns a string which end with the correct end-token when using console-waterworks-announcement`` () =
let result =
Pancake.RequestCleanTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) C o n s o l e W a t e r w o r k s
|> A s y n c . R u n S y n c h r o n o u s l y
Assert.Contains(".", r e s u l t )
|> E n d s A s I n t e n d e d
Assert.True r e s u l t
[ < F a c t > ]
let ``RequestTextFromFile returns a string which contains a full stop when using desktop-clock-info`` () =
let ``RequestClean TextFromFile returns a string which end with the correct end-token when using desktop-clock-info`` () =
let result =
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) D e s k t o p C l o c k
Pancake.RequestClean TextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) D e s k t o p C l o c k
|> A s y n c . R u n S y n c h r o n o u s l y
Assert.Contains(".", r e s u l t )
|> E n d s A s I n t e n d e d
Assert.True r e s u l t
[ < F a c t > ]
let ``RequestTextFromFile returns a string which contains a full stop when using test-post`` () =
let ``RequestClean TextFromFile returns a string which end with the correct end-token when using test-post`` () =
let result =
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) T e s t P o s t
Pancake.RequestClean TextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) T e s t P o s t
|> A s y n c . R u n S y n c h r o n o u s l y
Assert.Contains(".", r e s u l t )
|> E n d s A s I n t e n d e d
Assert.True r e s u l t
[ < F a c t > ]
let ``RequestTextFromFile returns a string which contains a full stop when using word-generator`` () =
let ``RequestClean TextFromFile returns a string which end with the correct end-token when using word-generator`` () =
let result =
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) W o r d G e n e r a t o r
Pancake.RequestClean TextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) W o r d G e n e r a t o r
|> A s y n c . R u n S y n c h r o n o u s l y
Assert.Contains(".", r e s u l t )
|> E n d s A s I n t e n d e d
Assert.True r e s u l t
[ < F a c t > ]
let ``RequestRandomText returns a string which ends with a full stop`` () =
let ``RequestCleanTextFromFile returns intended number of sentences when using console-waterworks-announcement`` () =
let desiredSentencesCount = ( V a l i d S e n t e n c e s I n p u t ( ) )
let result =
Pancake.RequestCleanTextFromFileAsync (ValidGibberishLevelInput()) desiredSentencesCount C o n s o l e W a t e r w o r k s
|> A s y n c . R u n S y n c h r o n o u s l y
|> C o u n t S e n t e n c e s
Assert.Equal(desiredSentencesCount, r e s u l t )
[ < F a c t > ]
let ``RequestCleanTextFromFile returns intended number of sentences when using desktop-clock-info`` () =
let desiredSentencesCount = ( V a l i d S e n t e n c e s I n p u t ( ) )
let result =
Pancake.RequestCleanTextFromFileAsync (ValidGibberishLevelInput()) desiredSentencesCount D e s k t o p C l o c k
|> A s y n c . R u n S y n c h r o n o u s l y
|> C o u n t S e n t e n c e s
Assert.Equal(desiredSentencesCount, r e s u l t )
[ < F a c t > ]
let ``RequestCleanTextFromFile returns intended number of sentences when using test-post`` () =
let desiredSentencesCount = ( V a l i d S e n t e n c e s I n p u t ( ) )
let result =
Pancake.RequestCleanTextFromFileAsync (ValidGibberishLevelInput()) desiredSentencesCount T e s t P o s t
|> A s y n c . R u n S y n c h r o n o u s l y
|> C o u n t S e n t e n c e s
Assert.Equal(desiredSentencesCount, r e s u l t )
[ < F a c t > ]
let ``RequestCleanTextFromFile returns intended number of sentences when using word-generator`` () =
let desiredSentencesCount = ( V a l i d S e n t e n c e s I n p u t ( ) )
let result =
Pancake.RequestCleanTextFromFileAsync (ValidGibberishLevelInput()) desiredSentencesCount W o r d G e n e r a t o r
|> A s y n c . R u n S y n c h r o n o u s l y
|> C o u n t S e n t e n c e s
Assert.Equal(desiredSentencesCount, r e s u l t )
[ < F a c t > ]
let ``RequestRandomText returns a string which ends with the correct end-token`` () =
let result =
Pancake.RequestRandomTextAsync ( )
|> A s y n c . R u n S y n c h r o n o u s l y
Assert.EndsWith(".", r e s u l t )
|> E n d s A s I n t e n d e d
A s s e r t . T r u e ( r e s u l t )
[ < F a c t > ]
let ``RequestText returns a string which ends with a full stop`` () =
let ``RequestText returns a string which ends with the correct end-token `` () =
let result =
Pancake.RequestTextAsync (ValidGibberishLevelInput()) ( V a l i d S e n t e n c e s I n p u t ( ) )
|> A s y n c . R u n S y n c h r o n o u s l y
Assert.EndsWith(".", r e s u l t )
|> E n d s A s I n t e n d e d
A s s e r t . T r u e ( r e s u l t )
[ < F a c t > ]
let ``RequestTextFromFile returns a string which ends with a full stop when using console-waterworks-announcement`` () =
let ``RequestTextFromFile returns a string which ends with the correct end-token when using console-waterworks-announcement`` () =
let result =
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) C o n s o l e W a t e r w o r k s
|> A s y n c . R u n S y n c h r o n o u s l y
Assert.EndsWith(".", r e s u l t )
|> E n d s A s I n t e n d e d
A s s e r t . T r u e ( r e s u l t )
[ < F a c t > ]
let ``RequestTextFromFile returns a sting which ends with a full stop when using desktop-clock-info`` () =
let ``RequestTextFromFile returns a sting which ends with the correct end-token when using desktop-clock-info`` () =
let result =
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) D e s k t o p C l o c k
|> A s y n c . R u n S y n c h r o n o u s l y
Assert.EndsWith(".", r e s u l t )
|> E n d s A s I n t e n d e d
A s s e r t . T r u e ( r e s u l t )
[ < F a c t > ]
let ``RequestTextFromFile returns a sting which ends with a full stop when using test-post`` () =
let ``RequestTextFromFile returns a sting which ends with the correct end-token when using test-post`` () =
let result =
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) T e s t P o s t
|> A s y n c . R u n S y n c h r o n o u s l y
Assert.EndsWith(".", r e s u l t )
|> E n d s A s I n t e n d e d
A s s e r t . T r u e ( r e s u l t )
[ < F a c t > ]
let ``RequestTextFromFile returns a sting which ends with a full stop when using word-generator`` () =
let ``RequestTextFromFile returns a sting which ends with the correct end-token when using word-generator`` () =
let result =
Pancake.RequestTextFromFileAsync (ValidGibberishLevelInput()) (ValidSentencesInput()) W o r d G e n e r a t o r
|> A s y n c . R u n S y n c h r o n o u s l y
Assert.EndsWith(".", r e s u l t )
[ < F a c t > ]
let ``RequestAllTemplateFiles does not return an empty list`` () =
let result =
Pancake.RequestAllTemplateFilesAsync ( )
|> A s y n c . R u n S y n c h r o n o u s l y
Assert.NotEmpty r e s u l t
|> E n d s A s I n t e n d e d
A s s e r t . T r u e ( r e s u l t )