learning F#, it seems pretty cool, favourite functional language so far.
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // This file was auto-generated based on version 1.1.1 of the canonical data.
  2. module KindergartenGardenTests
  3. open FsUnit.Xunit
  4. open Xunit
  5. open KindergartenGarden
  6. [<Fact>]
  7. let ``Partial garden - garden with single student`` () =
  8. let student = "Alice"
  9. let diagram = "RC\nGG"
  10. let expected = [Plant.Radishes; Plant.Clover; Plant.Grass; Plant.Grass]
  11. plants diagram student |> should equal expected
  12. [<Fact>]
  13. let ``Partial garden - different garden with single student`` () =
  14. let student = "Alice"
  15. let diagram = "VC\nRC"
  16. let expected = [Plant.Violets; Plant.Clover; Plant.Radishes; Plant.Clover]
  17. plants diagram student |> should equal expected
  18. [<Fact>]
  19. let ``Partial garden - garden with two students`` () =
  20. let student = "Bob"
  21. let diagram = "VVCG\nVVRC"
  22. let expected = [Plant.Clover; Plant.Grass; Plant.Radishes; Plant.Clover]
  23. plants diagram student |> should equal expected
  24. [<Fact>]
  25. let ``Partial garden - multiple students for the same garden with three students - second student's garden`` () =
  26. let student = "Bob"
  27. let diagram = "VVCCGG\nVVCCGG"
  28. let expected = [Plant.Clover; Plant.Clover; Plant.Clover; Plant.Clover]
  29. plants diagram student |> should equal expected
  30. [<Fact>]
  31. let ``Partial garden - multiple students for the same garden with three students - third student's garden`` () =
  32. let student = "Charlie"
  33. let diagram = "VVCCGG\nVVCCGG"
  34. let expected = [Plant.Grass; Plant.Grass; Plant.Grass; Plant.Grass]
  35. plants diagram student |> should equal expected
  36. [<Fact>]
  37. let ``Full garden - first student's garden`` () =
  38. let student = "Alice"
  39. let diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
  40. let expected = [Plant.Violets; Plant.Radishes; Plant.Violets; Plant.Radishes]
  41. plants diagram student |> should equal expected
  42. [<Fact>]
  43. let ``Full garden - second student's garden`` () =
  44. let student = "Bob"
  45. let diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
  46. let expected = [Plant.Clover; Plant.Grass; Plant.Clover; Plant.Clover]
  47. plants diagram student |> should equal expected
  48. [<Fact>]
  49. let ``Full garden - second to last student's garden`` () =
  50. let student = "Kincaid"
  51. let diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
  52. let expected = [Plant.Grass; Plant.Clover; Plant.Clover; Plant.Grass]
  53. plants diagram student |> should equal expected
  54. [<Fact>]
  55. let ``Full garden - last student's garden`` () =
  56. let student = "Larry"
  57. let diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
  58. let expected = [Plant.Grass; Plant.Violets; Plant.Clover; Plant.Violets]
  59. plants diagram student |> should equal expected