public void IfTransferFillsOneBucket_ThenOperationReturnsTrue() { TwoBucketLab twoBucketLab = new TwoBucketLab(new Bucket(5), new Bucket(3), 4); twoBucketLab.BucketB.FillBucket(); Assert.AreEqual(0, twoBucketLab.BucketA.Volume); Assert.AreEqual(3, twoBucketLab.BucketB.Volume); twoBucketLab.Transfer(twoBucketLab.BucketB, twoBucketLab.BucketA, 3); bool operationResult = twoBucketLab.Transfer(twoBucketLab.BucketA, twoBucketLab.BucketB, 3); Assert.IsTrue(operationResult); Assert.AreEqual(0, twoBucketLab.BucketA.Volume); Assert.AreEqual(3, twoBucketLab.BucketB.Volume); }
public void IfTransferDoesntFillOrEmptyOneBucket_ThenOperationReturnsFalse() { TwoBucketLab twoBucketLab = new TwoBucketLab(new Bucket(5), new Bucket(3), 4); twoBucketLab.BucketB.FillBucket(); Assert.AreEqual(0, twoBucketLab.BucketA.Volume); Assert.AreEqual(3, twoBucketLab.BucketB.Volume); bool operationResult = twoBucketLab.Transfer(twoBucketLab.BucketB, twoBucketLab.BucketA, 2); Assert.IsFalse(operationResult); Assert.AreEqual(0, twoBucketLab.BucketA.Volume); Assert.AreEqual(3, twoBucketLab.BucketB.Volume); }
public void Initialize(TwoBucketLab bucketLabState) { TwoBucketLab = bucketLabState; }