Example #1
0
        public void CheckSequinceDecoration()
        {
            IAnimal test         = new Duck();
            var     testDecorate = test.Decorate(new FirstDecorator(), new SecondDecorator());

            var result = testDecorate.SayHello();

            Assert.Equal("quack12", result);
        }
Example #2
0
        public void CheckDecorate()
        {
            IAnimal test         = new Duck();
            var     testDecorate = test.Decorate(new AngryDecorator());

            var result = testDecorate.SayHello();

            Assert.Equal("quack!!!", result);
        }
Example #3
0
        public void CheckManyDecoration()
        {
            IAnimal test         = new Duck();
            var     testDecorate = test.Decorate(new AngryDecorator(), new VeryAngryDecorator());

            var result = testDecorate.SayHello();

            Assert.Equal("QUACK!!!", result);
        }