Exemple #1
0
        public void AddAnimal()
        {
            MainCage mc = new MainCage();

            int weight = 10;
            int number = 0;

            Type[] expected = { typeof(Bear), typeof(Wolf), typeof(Giraffe) };

            mc.AddAnimal(weight);
            ICageComponent component = mc.isOne(number);

            foreach (var type in expected)
            {
                if (type == component.GetType())
                {
                    Assert.AreEqual(type, component.GetType());
                }
            }
        }
Exemple #2
0
        public void AddNewCage()
        {
            MainCage mc     = new MainCage();
            int      number = 0;

            mc.AddCage(mc);

            ICageComponent expected  = mc;
            ICageComponent component = mc.isOne(number);

            Assert.AreEqual(expected.GetType(), component.GetType());
        }
Exemple #3
0
        public void CageFromListComponent()
        {
            MainCage mc = new MainCage();
            List <ICageComponent> components = new List <ICageComponent>();

            components.Add(mc);

            int number = 0;

            mc.AddCage(mc);

            ICageComponent component = mc.isOne(number);
            ICageComponent expected  = components[number];

            Assert.AreEqual(expected.GetType(), component.GetType());
        }