Sha256: af3a9b52a022ea5825c230d5fb540655c07291aa417255eb0fbb661e7d63ba57

Contents?: true

Size: 1.91 KB

Versions: 142

Compression:

Stored size: 1.91 KB

Contents

using Xunit;

public class TwoBucketTest
{
    [Fact]
    public void First_example()
    {
        var bucketOneSize = 3;
        var bucketTwoSize = 5;
        var goal = 1;
        var startBucket = Bucket.One;
        var twoBuckets = new TwoBuckets(bucketOneSize, bucketTwoSize, startBucket);

        var actual = twoBuckets.Solve(goal);

        Assert.Equal(4, actual.Moves);
        Assert.Equal(Bucket.One, actual.GoalBucket);
        Assert.Equal(5, actual.OtherBucketContents);
    }

    [Fact(Skip = "Remove to run test")]
    public void Second_example()
    {
        var bucketOneSize = 3;
        var bucketTwoSize = 5;
        var goal = 1;
        var startBucket = Bucket.Two;
        var twoBuckets = new TwoBuckets(bucketOneSize, bucketTwoSize, startBucket);

        var actual = twoBuckets.Solve(goal);

        Assert.Equal(8, actual.Moves);
        Assert.Equal(Bucket.Two, actual.GoalBucket);
        Assert.Equal(3, actual.OtherBucketContents);
    }

    [Fact(Skip = "Remove to run test")]
    public void Third_example()
    {
        var bucketOneSize = 7;
        var bucketTwoSize = 11;
        var goal = 2;
        var startBucket = Bucket.One;
        var twoBuckets = new TwoBuckets(bucketOneSize, bucketTwoSize, startBucket);

        var actual = twoBuckets.Solve(goal);

        Assert.Equal(14, actual.Moves);
        Assert.Equal(Bucket.One, actual.GoalBucket);
        Assert.Equal(11, actual.OtherBucketContents);
    }

    [Fact(Skip = "Remove to run test")]
    public void Fourth_example()
    {
        var bucketOneSize = 7;
        var bucketTwoSize = 11;
        var goal = 2;
        var startBucket = Bucket.Two;
        var twoBuckets = new TwoBuckets(bucketOneSize, bucketTwoSize, startBucket);

        var actual = twoBuckets.Solve(goal);

        Assert.Equal(18, actual.Moves);
        Assert.Equal(Bucket.Two, actual.GoalBucket);
        Assert.Equal(7, actual.OtherBucketContents);
    }
}

Version data entries

142 entries across 142 versions & 1 rubygems

Version Path
trackler-2.2.1.19 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.18 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.17 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.16 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.15 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.14 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.13 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.12 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.11 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.10 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.9 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.8 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.7 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.6 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.5 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.4 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.3 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.2 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.1 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.0 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs