public void DealDamage_WhenDefenderIsNull_ShouldThrowArgumentNullException() { ICreaturesInBattle defender = null; var tested = new CreaturesInBattle(new AncientBehemoth(), 1); Assert.Throws <ArgumentNullException>(() => tested.DealDamage(defender)); }
public void DealDamage_WhenDefenderHasLargerDefence_ShouldReturnExpectedResult() { var defender = new CreaturesInBattle(new Behemoth(), 1); var attacker = new CreaturesInBattle(new AncientBehemoth(), 1); attacker.DealDamage(defender); var result = defender.TotalHitPoints; Assert.AreEqual(116, result); }
public void DealDamage_WhenDefenderIsValid_ShouldReturnExpectedResult() { var defender = new CreaturesInBattle(new Behemoth(), 2); var attacker = new CreaturesInBattle(new Behemoth(), 1); attacker.DealDamage(defender); var result = defender.TotalHitPoints; Assert.AreEqual(280, result); }
public void ReturnCorrectDefenderHitPoints_WhenDefenceIsNotHighterThanDamage() { var attackerInBattle = new CreaturesInBattle(new Angel(), 1); var defenderInBattle = new CreaturesInBattle(new Angel(), 1); var angelHitPointsAfterAngelAttack = 200 - 50; attackerInBattle.DealDamage(defenderInBattle); Assert.AreEqual(angelHitPointsAfterAngelAttack, defenderInBattle.TotalHitPoints); }
public void ThrowsArgumentNullException_WhenDefenderInBattleIsNull() { var attackerInBattle = new CreaturesInBattle(new Angel(), 1); Assert.Throws <ArgumentNullException>(() => attackerInBattle.DealDamage(null)); }