public void TestFill3() { var bottle = new Bottle(12); bottle.Fill(7); bottle.Fill(7); Assert.AreEqual(12, bottle.Content); }
public void FillFullBottle_ShouldReturnFalse() { var bottle = new Bottle(5); bottle.Fill(); var filled = bottle.Fill(); Assert.IsFalse(filled); }
public void FillEmptyBottle_ShouldReturnTrue() { var bottle = new Bottle(5); var filled = bottle.Fill(); Assert.IsTrue(filled); }
public void TransferBetweenBottles_ShouldSetCorrectAmmount() { var bottle1 = new Bottle(3); var bottle2 = new Bottle(5); bottle1.Fill(); bottle1.Transfer(ref bottle2); Assert.AreEqual(0, bottle1.Ammount); Assert.AreEqual(3, bottle2.Ammount); bottle1.Fill(); bottle1.Transfer(ref bottle2); Assert.AreEqual(1, bottle1.Ammount); Assert.AreEqual(5, bottle2.Ammount); }
public void FillEmptyBottle_ShouldSetCorrectAmmount() { var bottle = new Bottle(5); bottle.Fill(); Assert.AreEqual(5, bottle.Ammount); }
public void TestEmpty() { var bottle = new Bottle(12); bottle.Fill(7); bottle.Empty(); Assert.AreEqual(0, bottle.Content); }
public void TestFillToTopFromTapNotEmpty() { var bottle = new Bottle(12); bottle.Fill(3); bottle.FillToTopFromTap(); Assert.AreEqual(12, bottle.Content); }
public void PourFullBottle_ShouldSetCorrectAmmount() { var bottle = new Bottle(5); bottle.Fill(); bottle.Pour(); Assert.AreEqual(0, bottle.Ammount); }
public void PourFullBottle_ShouldReturnTrue() { var bottle = new Bottle(5); bottle.Fill(); var poured = bottle.Pour(); Assert.IsTrue(poured); }
public void IsBottleFull_ShouldReturnTrue() { var bottle1 = new Bottle(3); bottle1.Fill(); var full = bottle1.IsFull(); Assert.IsTrue(full); }
public void TestBottleFillOther() { var bottle = new Bottle(10); var bottle2 = new Bottle(5); bottle2.FillFromTap(); bottle.Fill(bottle2.Empty()); Assert.AreEqual(5, bottle.Content); Assert.AreEqual(0, bottle2.Content); }
public void TransferToFullBottle_ShouldReturnFalse() { var bottle1 = new Bottle(3); var bottle2 = new Bottle(5); bottle1.Fill(); bottle2.Fill(); var trans = bottle1.Transfer(ref bottle2); Assert.IsFalse(trans); }
private static void DoOperations(int[] operations, Bottle bottle1, Bottle bottle2, List <int> storage) { bottle1.Empty(); bottle2.Empty(); foreach (var operation in operations) { if (operation == 0) { bottle1.FillToTopFromTap(); } else if (operation == 1) { bottle2.FillToTopFromTap(); } else if (operation == 2) { bottle2.Fill(bottle1.Empty()); } else if (operation == 3) { bottle1.Fill(bottle2.Empty()); } else if (operation == 4) { bottle2.FillToTop(bottle1); } else if (operation == 5) { bottle1.FillToTop(bottle2); } else if (operation == 6) { bottle1.Empty(); } else if (operation == 7) { bottle2.Empty(); } //if (storage.Count > 300) storage = new List<int>(); storage.Add(bottle1.Content); storage.Add(bottle2.Content); } }
public void Run() { Bottle.Fill(Water); }