public void TestFillToTopFromTap() { var bottle = new Bottle(12); bottle.FillToTopFromTap(); Assert.AreEqual(12, bottle.Content); Assert.AreEqual(12, bottle.Capacity); }
public void TestFillToTopFromTapNotEmpty() { var bottle = new Bottle(12); bottle.Fill(3); bottle.FillToTopFromTap(); Assert.AreEqual(12, bottle.Content); }
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); } }