コード例 #1
0
        public void Can_be_order_more_than_one_coffee_in_the_morning()
        {
            var dishes = new List <Dish>()
            {
                MorningMenu.Choose(DishType.Drink),
                MorningMenu.Choose(DishType.Drink)
            };

            var validator = new OrderValidator();

            validator.ValidateDishesCount(dishes, TimeOfDay.Morning).Guard();
            Assert.Pass();
        }
コード例 #2
0
        public void Can_be_order_more_than_one_potatoes_in_the_night()
        {
            var dishes = new List <Dish>()
            {
                NightMenu.Choose(DishType.Side),
                NightMenu.Choose(DishType.Side)
            };

            var validator = new OrderValidator();

            validator.ValidateDishesCount(dishes, TimeOfDay.Night).Guard();
            Assert.Pass();
        }
コード例 #3
0
        public void Throw_exception_when_more_than_once_drink_on_night()
        {
            var dishes = new List <Dish>()
            {
                NightMenu.Choose(DishType.Drink),
                NightMenu.Choose(DishType.Drink)
            };

            var validator = new OrderValidator();

            Assert.Throws <GFTValidationException>(() =>
            {
                validator.ValidateDishesCount(dishes, TimeOfDay.Night).Guard();
            });
        }
コード例 #4
0
        public void Throw_exception_when_more_than_once_side_on_morning()
        {
            var dishes = new List <Dish>()
            {
                MorningMenu.Choose(DishType.Side),
                MorningMenu.Choose(DishType.Side)
            };

            var validator = new OrderValidator();

            Assert.Throws <GFTValidationException>(() =>
            {
                validator.ValidateDishesCount(dishes, TimeOfDay.Morning).Guard();
            });
        }