public CageTest()
 {
     bearCageFactory       = new BearCageFactory();
     femaleBearCageFactory = new FemaleBearCageFactory();
     bearCage       = bearCageFactory.CreateCage() as BearCage;
     bearFemaleCage = femaleBearCageFactory.CreateCage() as BearFemaleCage;
 }
        static void Main(string[] args)
        {
            {
                zoo     = new Zoo();
                console = ZooConsole.GetInstance(zoo);

                BearCage       bearCage       = bearCageFactory.CreateCage() as BearCage;
                BearFemaleCage bearFemaleCage = femaleBearCageFactory.CreateCage() as BearFemaleCage;
                zoo.Add(bearCage);
                zoo.Add(bearFemaleCage);

                Bear femaleBear = bearFactory.CreateAnimal(Models.Enums.MaleMode.Female) as Bear;
                Bear maleBear   = bearFactory.CreateAnimal(Models.Enums.MaleMode.Male) as Bear;
                femaleBear.Name   = "Female bear";
                maleBear.Name     = "Male bear";
                femaleBear.Weight = 40;
                maleBear.Weight   = 130;

                Container contForFemale = zoo.GetContainerForAnimal(femaleBear);
                contForFemale.Add(femaleBear);

                Container contForMale = zoo.GetContainerForAnimal(maleBear);
                contForMale.Add(maleBear);
            }
            while (true)
            {
                console.DisplayMainMenu();
            }
        }
Exemple #3
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);
        }
Exemple #4
0
        public ContainerTest()
        {
            zoo = Lab2Zoo.Models.Factories.ZooFactory.CreateZoo();

            bearCageFactory       = new BearCageFactory();
            bearFemaleCageFactory = new FemaleBearCageFactory();
            bearMaleCageFactory   = new MaleBearCageFactory();

            bearFactory    = new BearFactory();
            giraffeFactory = new GiraffeFactory();

            mainBearCage   = bearCageFactory.CreateCage() as BearCage;
            bearFemaleCage = bearFemaleCageFactory.CreateCage() as BearFemaleCage;
            bearMaleCage   = bearMaleCageFactory.CreateCage() as BearMaleCage;

            maleBear   = bearFactory.CreateAnimal(Lab2Zoo.Models.Enums.MaleMode.Male) as Bear;
            femaleBear = bearFactory.CreateAnimal(Lab2Zoo.Models.Enums.MaleMode.Female) as Bear;

            giraffe = giraffeFactory.CreateAnimal(15) as Giraffe;

            zoo.Add(bearMaleCage);
            zoo.Add(mainBearCage);
            mainBearCage.Add(bearFemaleCage);
        }
Exemple #5
0
 public void IsContainerCanContainsComponent_WhenComponentIsCage_ReturnsTrue()
 {
     Assert.True(zoo.IsContainerCanContainsComponent(bearCageFactory.CreateCage() as BearCage));
     Assert.True(bearMaleCage.IsContainerCanContainsComponent(bearMaleCageFactory.CreateCage() as BearMaleCage));
 }