Esempio n. 1
0
        public void PlaceAnimalInvalidType_SetGhoul_GetErrorString()
        {
            Cell   cell  = new TestCell("string");
            Animal ghoul = new Ghoul(10, "first");

            Assert.AreEqual("Animal must be testanimal", cell.PlaceAnimal(ghoul));
        }
Esempio n. 2
0
        public void AddCell_ContainsCell_True()
        {
            Cell super = new TestCell("base");
            Cell child = new TestCell("child");

            super.AddCell(child);
            Assert.IsTrue(super.cells.Contains(child));
        }
Esempio n. 3
0
        public void PlaceAnimalOnce_SetAnimal_GetAnimal()
        {
            Cell   cell   = new TestCell("string");
            Animal animal = new TestAnimal(10, "testanimal");

            cell.PlaceAnimal(animal);
            Assert.AreEqual(animal, cell.GetAnimal());
        }
Esempio n. 4
0
        public void PlaceAnimalTwice_SetTwoAnimals_GetFirstAnimal()
        {
            Cell   cell   = new TestCell("string");
            Animal first  = new TestAnimal(10, "first");
            Animal second = new TestAnimal(10, "second");

            cell.PlaceAnimal(first);
            cell.PlaceAnimal(second);
            Assert.AreNotEqual(second, cell.GetAnimal());
        }
Esempio n. 5
0
        public void GetCells_SetCellsWithField_GetWithMethod()
        {
            Cell super = new TestCell("base");
            Cell child = new TestCell("child");

            super.cells = new List <Cell>()
            {
                child
            };
            Assert.AreEqual(super.cells, super.GetCells());
        }
Esempio n. 6
0
        public void RemoveCell_ContainsCell_False()
        {
            Cell super = new TestCell("base");
            Cell child = new TestCell("child");

            super.cells = new List <Cell>()
            {
                child
            };
            super.RemoveCell(child);
            Assert.IsFalse(super.cells.Contains(child));
        }
Esempio n. 7
0
        public void PlaceAnimalNull_SetNull_GetException()
        {
            Cell cell = new TestCell("string");

            cell.PlaceAnimal(null);
        }