示例#1
0
        public void TestCarrotCakeRecipe()
        {
            var blankCake = new CarrotCake();
            var cooker    = new CarrotCakeCooker(blankCake);

            var finalResult = cooker.Cook();

            Assert.Equal("Carrots!", finalResult.SecretIngredient);
        }
示例#2
0
        public void Run()
        {
            var blankCake = new CarrotCake();
            var cooker    = new CarrotCakeCooker(blankCake);

            var finalResult = cooker.Cook();

            // now we can enjoy a delicious cake!!
        }
示例#3
0
        public void TestCarrotCakeHadIcingAdded()
        {
            CarrotCake carrotCake = new CarrotCake();

            carrotCake.Accept(_cakeVisitor); // throws

            Assert.Equal("Vanilla Icing", carrotCake.Icing);
            Assert.False(carrotCake.DoubleIcing);
        }
        public AbstractFactoryTest()
        {
            var factoryApp = new MainAbstractFactoryApp();

            _myCake = factoryApp.Main(new [] { "fancy" });
        }