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.39 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.38 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.37 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.36 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.35 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.34 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.33 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.32 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.31 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.30 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.29 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.28 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.27 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.26 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.25 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.24 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.23 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.22 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.21 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
trackler-2.2.1.20 tracks/csharp/exercises/two-bucket/TwoBucketTest.cs