예제 #1
0
        public void ReCreateAllBuns()
        {
            var      buns    = new List <IBun>();
            IFactory factory = new CroissantFactory();

            buns.Add(factory.CreateBun());
            factory = new PretzelFactory();
            buns.Add(factory.CreateBun());
            factory = new CreamBunFactory();
            buns.Add(factory.CreateBun());
            this.Buns = buns;
        }
예제 #2
0
        public void AddNewBuns()
        {
            var      buns    = new List <IBun>();
            IFactory factory = new CroissantFactory();

            buns.Add(factory.CreateBun());
            factory = new PretzelFactory();
            buns.Add(factory.CreateBun());
            factory = new CreamBunFactory();
            buns.Add(factory.CreateBun());
            this.Buns.AddRange(buns);
        }