Example #1
0
        public void TakeDamagHealthZeroTest()
        {
            IStarShip    starShip     = ShipFactory.CreateShip(ShipType.Fighter, ShipConfigurationType.Light);
            int          damageAmount = 9000;
            AttackResult attackResult = new AttackResult {
                Damage = damageAmount
            };

            starShip.TakeDamage(attackResult);
            Assert.Equal(0, starShip.Health);
        }
Example #2
0
        public void TakeDamageTest()
        {
            IStarShip    starShip     = ShipFactory.CreateShip(ShipType.Fighter, ShipConfigurationType.Light);
            var          oHealth      = starShip.Health;
            int          damageAmount = starShip.Armor + 20;
            AttackResult attackResult = new AttackResult {
                Damage = damageAmount
            };

            starShip.TakeDamage(attackResult);
            Assert.Equal(oHealth - 20, starShip.Health);
            Assert.Equal(0, starShip.Armor);
        }