Example #1
0
        public void Carnivore_Throws_InvalidFoodException_When_Eating_Vegetable()
        {
            var    myCarnivore       = new MyCarnivore();
            Action eatingFruitAction = () => myCarnivore.Eat(new Carrot());

            eatingFruitAction.Should()
            .Throw <InvalidFoodException>()
            .WithMessage("As a MyCarnivore I cannot eat Carrot");
        }
Example #2
0
        public void Carnivore_Cannot_Eat_Fruit()
        {
            var myCarnivore = new MyCarnivore();

            myCarnivore.CanEat(new Banana()).Should().BeFalse();
        }
Example #3
0
        public void Carnivore_Cannot_Eat_Vegetable()
        {
            var myCarnivore = new MyCarnivore();

            myCarnivore.CanEat(new Carrot()).Should().BeFalse();
        }
Example #4
0
        public void Carnivore_Can_Eat_Meat()
        {
            var myCarnivore = new MyCarnivore();

            myCarnivore.CanEat(new Pork()).Should().BeTrue();
        }