Esempio n. 1
0
        public GiraffeCageTestClass()
        {
            adultGiraffeCageFactory    = new AdultGiraffeCageFactory();
            childrenGiraffeCageFactory = new ChildrenGiraffeCageFactory();
            giraffeCageFactory         = new GiraffeCageFactory();
            giraffeFactory             = new GiraffeFactory();

            giraffeCage         = giraffeCageFactory.CreateCage() as GiraffeCage;
            giraffeAdultCage    = adultGiraffeCageFactory.CreateCage() as GiraffeAdultCage;
            giraffeChildrenCage = childrenGiraffeCageFactory.CreateCage() as GiraffeChildrenCage;

            giraffe = giraffeFactory.CreateAnimal() as Giraffe;
        }
Esempio n. 2
0
        public ZooTest()
        {
            zoo = Lab2Zoo.Models.Factories.ZooFactory.CreateZoo();
            giraffeCageFactory = new GiraffeCageFactory();
            giraffeFactory     = new GiraffeFactory();
            bearFactory        = new BearFactory();
            bearCageFactory    = new BearCageFactory();

            giraffe     = giraffeFactory.CreateAnimal() as Giraffe;
            bear        = bearFactory.CreateAnimal() as Bear;
            giraffeCage = giraffeCageFactory.CreateCage() as GiraffeCage;
            bearCage    = bearCageFactory.CreateCage() as BearCage;

            zoo.Add(giraffeCage);
            zoo.Add(bearCage);

            giraffeCage.Add(giraffe);
            bearCage.Add(bear);
        }