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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// This file was auto-generated based on version 1.4.0 of the canonical data.

module TwoBucketTest

open FsUnit.Xunit
open Xunit

open TwoBucket

[<Fact>]
let ``Measure using bucket one of size 3 and bucket two of size 5 - start with bucket one`` () =
    let bucketOne = 3
    let bucketTwo = 5
    let goal = 1
    let startBucket = Bucket.One
    let expected = { Moves = 4; GoalBucket = Bucket.One; OtherBucket = 5 }
    measure bucketOne bucketTwo goal startBucket |> should equal expected

[<Fact(Skip = "Remove to run test")>]
let ``Measure using bucket one of size 3 and bucket two of size 5 - start with bucket two`` () =
    let bucketOne = 3
    let bucketTwo = 5
    let goal = 1
    let startBucket = Bucket.Two
    let expected = { Moves = 8; GoalBucket = Bucket.Two; OtherBucket = 3 }
    measure bucketOne bucketTwo goal startBucket |> should equal expected

[<Fact(Skip = "Remove to run test")>]
let ``Measure using bucket one of size 7 and bucket two of size 11 - start with bucket one`` () =
    let bucketOne = 7
    let bucketTwo = 11
    let goal = 2
    let startBucket = Bucket.One
    let expected = { Moves = 14; GoalBucket = Bucket.One; OtherBucket = 11 }
    measure bucketOne bucketTwo goal startBucket |> should equal expected

[<Fact(Skip = "Remove to run test")>]
let ``Measure using bucket one of size 7 and bucket two of size 11 - start with bucket two`` () =
    let bucketOne = 7
    let bucketTwo = 11
    let goal = 2
    let startBucket = Bucket.Two
    let expected = { Moves = 18; GoalBucket = Bucket.Two; OtherBucket = 7 }
    measure bucketOne bucketTwo goal startBucket |> should equal expected

[<Fact(Skip = "Remove to run test")>]
let ``Measure one step using bucket one of size 1 and bucket two of size 3 - start with bucket two`` () =
    let bucketOne = 1
    let bucketTwo = 3
    let goal = 3
    let startBucket = Bucket.Two
    let expected = { Moves = 1; GoalBucket = Bucket.Two; OtherBucket = 0 }
    measure bucketOne bucketTwo goal startBucket |> should equal expected

[<Fact(Skip = "Remove to run test")>]
let ``Measure using bucket one of size 2 and bucket two of size 3 - start with bucket one and end with bucket two`` () =
    let bucketOne = 2
    let bucketTwo = 3
    let goal = 3
    let startBucket = Bucket.One
    let expected = { Moves = 2; GoalBucket = Bucket.Two; OtherBucket = 2 }
    measure bucketOne bucketTwo goal startBucket |> should equal expected