Skip to content

Instantly share code, notes, and snippets.

@CoditCompany
Created August 13, 2017 11:32
Show Gist options
  • Select an option

  • Save CoditCompany/526357c941f215f2dca5b43a8085fc41 to your computer and use it in GitHub Desktop.

Select an option

Save CoditCompany/526357c941f215f2dca5b43a8085fc41 to your computer and use it in GitHub Desktop.
[<Property>]
let ``String50 don't gets created if length isn't 50 chars`` () =
Arb.generate<string>
|> Gen.filter (String.length >> (<>) 50)
|> Arb.fromGen
|> Prop.forAll <| fun x ->
None = string50 x
[<Property>]
let ``String50 gets created if length is 50 chars`` () =
Arb.generate<char>
|> Gen.listOfLength 50
|> Gen.map (List.map string >> List.reduce (+))
|> Arb.fromGen
|> Prop.forAll <| fun x ->
Some <| String50 x = string50 x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment