Exemplo n.º 1
0
        private IEnumerable <IAnimal> TryDie(IAnimal animal, IEnumerable <IAnimal> animals)
        {
            if (animal.Health <= 0)
            {
                animals = _healthLogic.Die(animals.ToList());
            }

            animals = _animalLogic.RemoveDeadAnimals(animals);

            return(animals);
        }
Exemplo n.º 2
0
        public void Die_When_ZeroHealth_Expect_MarkedWithX()
        {
            //Arrange
            var animal = new Lion()
            {
                Health = 0
            };
            var animalList = new List <IAnimal> {
                animal
            };

            //Act
            var result = _classUnderTest.Die(animalList).Where(x => x == animal).FirstOrDefault();

            //Assert
            Assert.AreEqual(ConstantValues.Dead, result.Symbol);
        }