1
exercism fetch fsharp two-bucket

TwoBucketTest.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
module TwoBucketTest

open Xunit
open FsUnit.Xunit

open TwoBucket

[<Fact>]
let ``First example``() =
    let bucketOneSize = 3
    let bucketTwoSize = 5
    let goal = 1
    let startBucket = Bucket.One

    let actual = moves bucketOneSize bucketTwoSize goal startBucket
    actual |> should equal <| Some (4, Bucket.One, 5)

[<Fact(Skip = "Remove to run test")>]
let ``Second example``() =
    let bucketOneSize = 3
    let bucketTwoSize = 5
    let goal = 1
    let startBucket = Bucket.Two

    let actual = moves bucketOneSize bucketTwoSize goal startBucket
    actual |> should equal <| Some (8, Bucket.Two, 3)

[<Fact(Skip = "Remove to run test")>]
let ``Third example``() =
    let bucketOneSize = 7
    let bucketTwoSize = 11
    let goal = 2
    let startBucket = Bucket.One

    let actual = moves bucketOneSize bucketTwoSize goal startBucket
    actual |> should equal <| Some (14, Bucket.One, 11)

[<Fact(Skip = "Remove to run test")>]
let ``Fourth example``() =
    let bucketOneSize = 7
    let bucketTwoSize = 11
    let goal = 2
    let startBucket = Bucket.Two

    let actual = moves bucketOneSize bucketTwoSize goal startBucket
    actual |> should equal <| Some (18, Bucket.Two, 7)