Guest User

Untitled

a guest
Mar 21st, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. module Tests
  2.  
  3. open Xunit
  4. open FsCheck.Xunit
  5. open WidgetCo.Core
  6.  
  7. open Say
  8. open System.Text
  9. open FsCheck
  10.  
  11. [<Theory>]
  12. [<InlineData(1, 2, 3)>]
  13. [<InlineData(2, 2, 4)>]
  14. [<InlineData(3, 3, 6)>]
  15. let ``My inline unit tests`` (x, y, expected) =
  16. (add x y) = expected
  17.  
  18. [<Property>]
  19. let ``Different path, Same Destination`` (x:int, y:int) =
  20. (add x y) = (add y x)
  21.  
  22. [<Property>]
  23. let ``There and back again`` (expected : NonEmptyString) =
  24. let s = expected.Get
  25. s = (s |> Encoding.ASCII.GetBytes |> Encoding.ASCII.GetString)
  26.  
  27. [<Property>]
  28. let ``Some things never change`` (xs:List<int>) =
  29. List.length xs = (xs |> List.sort |> List.length)
  30.  
  31. [<Property>]
  32. let ``The more things change, the more they stay the same`` (xs:List<int>) =
  33. (List.distinct xs) = (xs |> List.distinct |> List.distinct)
Add Comment
Please, Sign In to add comment