public void Attack_DecreasesEnemyHpByAttackerDamage() { int warriorInitialHp = 100; var attacker = new Warrior("Attacker", 50, 100); var warrior = new Warrior("Warrrior", 30, warriorInitialHp); attacker.Attack(warrior); Assert.That(warrior.HP, Is.EqualTo(warriorInitialHp - attacker.Damage)); }
public void WarriorsCannotAtackOtherWarriorThatHasLessThan30Hp() { Warrior pesho = new Warrior("Pesho", 20, 50); Warrior gosho = new Warrior("Gosho", 15, 29); Assert.Throws <InvalidOperationException>(() => { pesho.Attack(gosho); }); }
public void TestAttackWithLowHp() { Warrior attacker = new Warrior("Pesho", 10, 25); Warrior defender = new Warrior("Gosho", 5, 45); Assert.Throws <InvalidOperationException>(() => { attacker.Attack(defender); }); }
public void AttackMethodShouldThrowInvalidOperationExceptionWhenDefenderHpIsLessOrEqual30( string defenderName, int defenderDamage, int defenderHp) { Warrior attacker = new Warrior("SunshineWarrion", 200, 500); Warrior defender = new Warrior(defenderName, defenderDamage, defenderHp); Assert.Throws <InvalidOperationException>( () => attacker.Attack(defender)); }
public void WarriorsCannotAtackStrongerWarriorThanThem() { Warrior pesho = new Warrior("Pesho", 20, 50); Warrior gosho = new Warrior("Gosho", 1000, 50); Assert.Throws <InvalidOperationException>(() => { pesho.Attack(gosho); }); }
public void ShouldThrowInvalidOperationExceptionWhenTryToAttackEnenyWithLowThanMinHp(int defenderHp) { Warrior attacker = new Warrior("Vladi", 10, 100); Warrior defender = new Warrior("Oki", 10, defenderHp); Assert.Throws <InvalidOperationException>(() => { attacker.Attack(defender); }); }
public void BothWarriorShouldTakeDamageWhenAttackEachOther() { Warrior attacker = new Warrior("Vladi", 10, 40); Warrior defender = new Warrior("Oki", 5, 50); attacker.Attack(defender); Assert.AreEqual(35, attacker.HP); Assert.AreEqual(40, defender.HP); }
public void WarriorShouldThrowExceptionWhenVictimHPAreBelowOrEqual30AndTryAttack(string name, int damage, int hp) { Warrior warrior1 = new Warrior("Tosho", 50, 40); Warrior warrior2 = new Warrior(name, damage, hp); Assert.Throws <InvalidOperationException>(() => { warrior1.Attack(warrior2); }); }
public void WarriorShouldThrowExceptionWhenVictimDamageAreBiggerThanHisHP(string name, int damage, int hp) { Warrior warrior1 = new Warrior("Tosho", 50, 40); Warrior warrior2 = new Warrior(name, damage, hp); Assert.Throws <InvalidOperationException>(() => { warrior1.Attack(warrior2); }); }
public void MethodShouldThrowInvalidOperationExceptionWhenWarriorAttackEnemyWithHpBellow30() { var name = "Pesho"; var damage = 30; var hp = 30; Warrior warrior = new Warrior(name, damage, hp); Assert.Throws <InvalidOperationException>(() => warrior.Attack(new Warrior("Gosho", 20, 20))); }
public void MethodShouldTestTheReduceHpOfAttackedWarrior() { Warrior warrior = new Warrior("Pesho", 30, 40); Warrior enemy = new Warrior("Gosho", 20, 40); warrior.Attack(enemy); var expectedHpEnemy = 10; var actualHpEnemy = enemy.HP; Assert.AreEqual(expectedHpEnemy, actualHpEnemy); warrior.Attack(enemy); var expectedHpEnemyAfterSecondAttack = 0; var actualHpEnemyAfterSecondAttack = enemy.HP; Assert.AreEqual(expectedHpEnemyAfterSecondAttack, actualHpEnemyAfterSecondAttack); }
public void TestHpAfterAttack() { Warrior warriorA = new Warrior("Pesho", 20, 60); Warrior warriorB = new Warrior("Gosho", 40, 50); warriorA.Attack(warriorB); Assert.That(warriorA.HP, Is.EqualTo(20)); Assert.That(warriorB.HP, Is.EqualTo(30)); }
public void Attack_Should_Throw_Exception_When_Hp_Lower_Then_31(int hp) { Warrior myWarrior = new Warrior("Stiv", 20, hp); Warrior enemy = new Warrior("Peter", 20, 40); Assert.Throws <InvalidOperationException>(() => { myWarrior.Attack(enemy); }); }
public void Attack_Should_Throw_Exception_Hp_Lower_Then_Enemys_Damage() { Warrior myWarrior = new Warrior("Stiv", 100, 90); Warrior enemy = new Warrior("Peter", 100, 100); Assert.Throws <InvalidOperationException>(() => { myWarrior.Attack(enemy); }); }
public void AttackShouldThrowExceptionWhenDHpBelowMinIs(int hp) { Warrior attacker = new Warrior("name", 10, 100); Warrior def = new Warrior("some", 10, hp); Assert.Throws <InvalidOperationException>(() => { attacker.Attack(def); }, "Enemy HP must be greater than 30 in order to attack him!"); }
static void Main(string[] args) { Human pesho = new Human(100, "Pesho", "Peshov", 98); Warrior asparuh = new Warrior(100, "Han", "Asparagus", 1000); Weapon axe = new Weapon(10, 10, 100, 5, 50, 50, 51, 1); asparuh.SetTarget(pesho); asparuh.Attack(axe); Console.WriteLine(asparuh.Target.Health); }
public void ShouldThrowInvalidOperationExceptionWhenHpIsTooLowAndTryToAttackOtherWarriors(int attackerHp) { Warrior attacker = new Warrior("Vladi", 10, attackerHp); Warrior defender = new Warrior("Oki", 10, 40); Assert.Throws <InvalidOperationException>(() => { attacker.Attack(defender); }); }
public void AttackMethodShouldThrowExceptionIfWarriorTryAttackStrongerEnemies() { var warrior = new Warrior("Svetlio", 100, 50); var opponent = new Warrior("Test", 100, 200); Assert.Throws <InvalidOperationException>(() => { warrior.Attack(opponent); }); }
public void ShouldThrowInvalidOperationExceptionWhenTryToAttackTooStrongerEnemy() { Warrior attacker = new Warrior("Vladi", 10, 35); Warrior defender = new Warrior("Oki", 40, 35); Assert.Throws <InvalidOperationException>(() => { attacker.Attack(defender); }); }
public void AttackMethodShouldThrowExceptionIfWarriorTryToAttackWarriorsWhichHPbBelow30(int belowHP) { var warrior = new Warrior("Svetlio", 100, 200); var opponent = new Warrior("Test", 10, belowHP); Assert.Throws <InvalidOperationException>(() => { warrior.Attack(opponent); }); }
public void WarriorShouldTakeDamageWhenAttackEnemyAndIfEnemyWarrirDieHisHpShouldBeZero() { Warrior attacker = new Warrior("Vladi", 80, 100); Warrior defender = new Warrior("Oki", 10, 60); attacker.Attack(defender); Assert.AreEqual(90, attacker.HP); Assert.AreEqual(0, defender.HP); }
public void Warrior_Attacked_Decreas_HP() { Warrior warrior = new Warrior("Gosho", 50, 52); warrior.Attack(new Warrior("Pesho", 40, 40)); int hp = warrior.HP; Assert.AreEqual(hp, 12); }
public void AttackMethodShouldThrowInvalidOperationExceptionWhenAttackerHpIsLessThanDeffenderAttack() { int attackerHp = 100; int deffenderAttack = 101; Warrior attackWarrior = new Warrior("FireWarrior", 100, attackerHp); Warrior deffenderWarrior = new Warrior("WaterWarrior", deffenderAttack, 200); Assert.Throws <InvalidOperationException>( () => attackWarrior.Attack(deffenderWarrior)); }
public void Throw_An_Exception_If_The_Health_Is_Less_Or_Equal_To_Zero_Than_The_Enemy_Damage() { // Arrange var warrior = new Warrior("Stavri", 100, 90); var enemy = new Warrior("Ivan", 100, 100); // Assert Assert.Throws <InvalidOperationException>( () => warrior.Attack(enemy)); }
public void WarriorShouldNotBeAbleToAtackIfHpIsLessThan30() { Warrior pesho = new Warrior("Pesho", 20, 10); Warrior gosho = new Warrior("Gosho", 15, 50); Assert.Throws <InvalidOperationException>(() => { pesho.Attack(gosho); }); }
public void Attack_DecreasesEnemyHpByAttackerDamage() { int initialWarriorHp = 100; Warrior attacker = new Warrior("Attacker", 50, 100); Warrior warrior = new Warrior("Warrior", 50, initialWarriorHp); attacker.Attack(warrior); Assert.AreEqual(initialWarriorHp - attacker.Damage, warrior.HP); }
public void TestAttackingStrongerEnemy() { Warrior attacker = new Warrior("Pesho", 10, 35); Warrior defender = new Warrior("Gosho", 40, 100); Assert.Throws <InvalidOperationException>(() => { attacker.Attack(defender); }); }
public void AttackShouldThrowExceptionWhenAHpBelowMinIs(int hp) { Warrior attacker = new Warrior("some name", 50, hp); Warrior defender = new Warrior("def", 10, 40); Assert.Throws <InvalidOperationException>(() => { attacker.Attack(defender); }, "Your HP is too low in order to attack other warriors!"); }
public void Attack_DecreaseHpWithAttack() { int initialHp = 100; var attacker = new Warrior("Attacker", 50, initialHp); var warrior = new Warrior("Warrrior", 30, 100); attacker.Attack(warrior); Assert.That(attacker.HP, Is.EqualTo(initialHp - warrior.Damage)); }
public void AttackMethodWorkCorrectly() { var attackWarrior = new Warrior("ivan", 5, 50); warrior.Attack(attackWarrior); int expectionAttackWarriorHp = 40; int expectionWarriorHp = 95; Assert.AreEqual(expectionWarriorHp, warrior.HP); Assert.AreEqual(expectionAttackWarriorHp, attackWarrior.HP); }