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.

HighScoresTests.fs 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // This file was auto-generated based on version 4.0.0 of the canonical data.
  2. module HighScoresTests
  3. open FsUnit.Xunit
  4. open Xunit
  5. open HighScores
  6. [<Fact>]
  7. let ``List of scores`` () =
  8. scores [30; 50; 20; 70] |> should equal [30; 50; 20; 70]
  9. [<Fact>]
  10. let ``Latest score`` () =
  11. latest [100; 0; 90; 30] |> should equal 30
  12. [<Fact>]
  13. let ``Personal best`` () =
  14. personalBest [40; 100; 70] |> should equal 100
  15. [<Fact>]
  16. let ``Personal top three from a list of scores`` () =
  17. personalTopThree [10; 30; 90; 30; 100; 20; 10; 0; 30; 40; 40; 70; 70] |> should equal [100; 90; 70]
  18. [<Fact>]
  19. let ``Personal top highest to lowest`` () =
  20. personalTopThree [20; 10; 30] |> should equal [30; 20; 10]
  21. [<Fact>]
  22. let ``Personal top when there is a tie`` () =
  23. personalTopThree [40; 20; 40; 30] |> should equal [40; 40; 30]
  24. [<Fact>]
  25. let ``Personal top when there are less than 3`` () =
  26. personalTopThree [30; 70] |> should equal [70; 30]
  27. [<Fact>]
  28. let ``Personal top when there is only one`` () =
  29. personalTopThree [40] |> should equal [40]