1
exercism fetch fsharp kindergarten-garden

KindergartenGardenTest.fs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// This file was auto-generated based on version 1.0.0 of the canonical data.

module KindergartenGardenTest

open FsUnit.Xunit
open Xunit

open KindergartenGarden

[<Fact>]
let ``Partial garden - garden with single student`` () =
    let student = "Alice"
    let diagram = "RC\nGG"
    let expected = [Plant.Radishes; Plant.Clover; Plant.Grass; Plant.Grass]
    plants diagram student |> should equal expected

[<Fact(Skip = "Remove to run test")>]
let ``Partial garden - different garden with single student`` () =
    let student = "Alice"
    let diagram = "VC\nRC"
    let expected = [Plant.Violets; Plant.Clover; Plant.Radishes; Plant.Clover]
    plants diagram student |> should equal expected

[<Fact(Skip = "Remove to run test")>]
let ``Partial garden - garden with two students`` () =
    let student = "Bob"
    let diagram = "VVCG\nVVRC"
    let expected = [Plant.Clover; Plant.Grass; Plant.Radishes; Plant.Clover]
    plants diagram student |> should equal expected

[<Fact(Skip = "Remove to run test")>]
let ``Partial garden - multiple students for the same garden with three students - second student's garden`` () =
    let student = "Bob"
    let diagram = "VVCCGG\nVVCCGG"
    let expected = [Plant.Clover; Plant.Clover; Plant.Clover; Plant.Clover]
    plants diagram student |> should equal expected

[<Fact(Skip = "Remove to run test")>]
let ``Partial garden - multiple students for the same garden with three students - third student's garden`` () =
    let student = "Charlie"
    let diagram = "VVCCGG\nVVCCGG"
    let expected = [Plant.Grass; Plant.Grass; Plant.Grass; Plant.Grass]
    plants diagram student |> should equal expected

[<Fact(Skip = "Remove to run test")>]
let ``Full garden - first student's garden`` () =
    let student = "Alice"
    let diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
    let expected = [Plant.Violets; Plant.Radishes; Plant.Violets; Plant.Radishes]
    plants diagram student |> should equal expected

[<Fact(Skip = "Remove to run test")>]
let ``Full garden - second student's garden`` () =
    let student = "Bob"
    let diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
    let expected = [Plant.Clover; Plant.Grass; Plant.Clover; Plant.Clover]
    plants diagram student |> should equal expected

[<Fact(Skip = "Remove to run test")>]
let ``Full garden - second to last student's garden`` () =
    let student = "Kincaid"
    let diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
    let expected = [Plant.Grass; Plant.Clover; Plant.Clover; Plant.Grass]
    plants diagram student |> should equal expected

[<Fact(Skip = "Remove to run test")>]
let ``Full garden - last student's garden`` () =
    let student = "Larry"
    let diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
    let expected = [Plant.Grass; Plant.Violets; Plant.Clover; Plant.Violets]
    plants diagram student |> should equal expected