Exemplo n.º 1
0
        public void TestBottleFillTap()
        {
            var bottle = new Bottle(10);

            bottle.FillFromTap();

            Assert.AreEqual(10, bottle.Content);
        }
Exemplo n.º 2
0
        public void TestBottleFillToTop()
        {
            var bottle  = new Bottle(10);
            var bottle2 = new Bottle(5);

            bottle2.FillFromTap();
            bottle.FillToTop(bottle2);

            Assert.AreEqual(0, bottle2.Content);
            Assert.AreEqual(5, bottle.Content);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        public void TestBottleEmpty()
        {
            var bottle = new Bottle(10);

            bottle.FillFromTap();

            Assert.AreEqual(10, bottle.Content);

            var oldContent = bottle.Empty();

            Assert.AreEqual(10, oldContent);
            Assert.AreEqual(0, bottle.Content);
        }