Beispiel #1
0
        public void GetStatus_ShouldBeFullStatusPantry()
        {
            var controller = new IToast.Controllers.PantryController();

            controller.PutBreads(91);

            Assert.IsTrue(controller.GetStatus() == PantryStatus.Full, "Pantry full of breads");
        }
Beispiel #2
0
        public void GetStatus_ShouldBeNormalStatusPantry()
        {
            var controller = new IToast.Controllers.PantryController();

            controller.PutBreads(49);

            Assert.IsTrue(controller.GetStatus() == PantryStatus.Normal, "Pantry normal number of breads");
        }
Beispiel #3
0
        public void GetStatus_ShouldBeAlmostEmptyStatusPantry()
        {
            var controller = new IToast.Controllers.PantryController();

            controller.PutBreads(6);

            Assert.IsTrue(controller.GetStatus() == PantryStatus.AlmostEmpty, "Pantry almost empty of breads");
        }
Beispiel #4
0
        public void HasBread_ShouldHaveBread()
        {
            var controller = new IToast.Controllers.PantryController();

            controller.PutBreads(0);
            controller.BuyToSupermarket(20);

            Assert.IsTrue(controller.HasBread(), "Pantry has bread");
        }
Beispiel #5
0
        public void PutBreads_ShouldReturn50BreadsInPantry()
        {
            var controller = new IToast.Controllers.PantryController();

            controller.PutBreads(50);

            int howmanybreads = controller.HowManyBreads();

            Assert.IsTrue(howmanybreads == 50, "There are 50 breads in pantry");
        }
Beispiel #6
0
        public void GetBreads_ShouldTwoBreadsMinus()
        {
            var controller = new IToast.Controllers.PantryController();

            controller.PutBreads(50);

            int toasts = 2;

            int howManyBreadsBeforeToasting = controller.HowManyBreads();

            controller.GetBreads(toasts);

            int howManyBreadsAfterToasting = controller.HowManyBreads();

            Assert.AreEqual(howManyBreadsBeforeToasting - howManyBreadsAfterToasting, toasts);
        }