1
exercism fetch csharp two-bucket

TwoBucketTest.cs

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
// This file was auto-generated based on version 1.2.0 of the canonical data.

using Xunit;

public class TwoBucketTest
{
    [Fact]
    public void Measure_using_bucket_one_of_size_3_and_bucket_two_of_size_5_start_with_bucket_one()
    {
        var sut = new TwoBucket(3, 5, Bucket.One);
        var result = sut.Measure(1);
        Assert.Equal(4, result.Moves);
        Assert.Equal(5, result.OtherBucket);
        Assert.Equal(Bucket.One, result.GoalBucket);
    }

    [Fact(Skip = "Remove to run test")]
    public void Measure_using_bucket_one_of_size_3_and_bucket_two_of_size_5_start_with_bucket_two()
    {
        var sut = new TwoBucket(3, 5, Bucket.Two);
        var result = sut.Measure(1);
        Assert.Equal(8, result.Moves);
        Assert.Equal(3, result.OtherBucket);
        Assert.Equal(Bucket.Two, result.GoalBucket);
    }

    [Fact(Skip = "Remove to run test")]
    public void Measure_using_bucket_one_of_size_7_and_bucket_two_of_size_11_start_with_bucket_one()
    {
        var sut = new TwoBucket(7, 11, Bucket.One);
        var result = sut.Measure(2);
        Assert.Equal(14, result.Moves);
        Assert.Equal(11, result.OtherBucket);
        Assert.Equal(Bucket.One, result.GoalBucket);
    }

    [Fact(Skip = "Remove to run test")]
    public void Measure_using_bucket_one_of_size_7_and_bucket_two_of_size_11_start_with_bucket_two()
    {
        var sut = new TwoBucket(7, 11, Bucket.Two);
        var result = sut.Measure(2);
        Assert.Equal(18, result.Moves);
        Assert.Equal(7, result.OtherBucket);
        Assert.Equal(Bucket.Two, result.GoalBucket);
    }

    [Fact(Skip = "Remove to run test")]
    public void Measure_one_step_using_bucket_one_of_size_1_and_bucket_two_of_size_3_start_with_bucket_two()
    {
        var sut = new TwoBucket(1, 3, Bucket.Two);
        var result = sut.Measure(3);
        Assert.Equal(1, result.Moves);
        Assert.Equal(0, result.OtherBucket);
        Assert.Equal(Bucket.Two, result.GoalBucket);
    }

    [Fact(Skip = "Remove to run test")]
    public void Measure_using_bucket_one_of_size_2_and_bucket_two_of_size_3_start_with_bucket_one_and_end_with_bucket_two()
    {
        var sut = new TwoBucket(2, 3, Bucket.One);
        var result = sut.Measure(3);
        Assert.Equal(2, result.Moves);
        Assert.Equal(2, result.OtherBucket);
        Assert.Equal(Bucket.Two, result.GoalBucket);
    }
}