learning F#, it seems pretty cool, favourite functional language so far.
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

DartsTests.fs 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // This file was auto-generated based on version 2.2.0 of the canonical data.
  2. module DartsTests
  3. open FsUnit.Xunit
  4. open Xunit
  5. open Darts
  6. [<Fact>]
  7. let ``Missed target`` () =
  8. score -9.0 9.0 |> should equal 0
  9. [<Fact>]
  10. let ``On the outer circle`` () =
  11. score 0.0 10.0 |> should equal 1
  12. [<Fact>]
  13. let ``On the middle circle`` () =
  14. score -5.0 0.0 |> should equal 5
  15. [<Fact>]
  16. let ``On the inner circle`` () =
  17. score 0.0 -1.0 |> should equal 10
  18. [<Fact>]
  19. let ``Exactly on centre`` () =
  20. score 0.0 0.0 |> should equal 10
  21. [<Fact>]
  22. let ``Near the centre`` () =
  23. score -0.1 -0.1 |> should equal 10
  24. [<Fact>]
  25. let ``Just within the inner circle`` () =
  26. score 0.7 0.7 |> should equal 10
  27. [<Fact>]
  28. let ``Just outside the inner circle`` () =
  29. score 0.8 -0.8 |> should equal 5
  30. [<Fact>]
  31. let ``Just within the middle circle`` () =
  32. score -3.5 3.5 |> should equal 5
  33. [<Fact>]
  34. let ``Just outside the middle circle`` () =
  35. score -3.6 -3.6 |> should equal 1
  36. [<Fact>]
  37. let ``Just within the outer circle`` () =
  38. score -7.0 7.0 |> should equal 1
  39. [<Fact>]
  40. let ``Just outside the outer circle`` () =
  41. score 7.1 -7.1 |> should equal 0
  42. [<Fact>]
  43. let ``Asymmetric position between the inner and middle circles`` () =
  44. score 0.5 -4.0 |> should equal 5