public void WeaponLosesDurabilityAfterEachAttack() { axe.Attack(dummy); Assert.That(axe.DurabilityPoints, Is.EqualTo(axeExpectedDurabilityPoints), "Axe Durability does not change after attack !"); }
public void DummyLosesHealthIfAttacked() { axe.Attack(dummy); int expectdHealth = 10; Assert.AreEqual(dummy.Health, expectdHealth, "Dummy does not lose health after attack!"); }
public void AxeLosesDurabilyAfterAttack() { axe.Attack(dummy); Assert.AreEqual(1, axe.DurabilityPoints, "Axe Durability doesn't change after attack"); }
public void AttackingWithABrokenWeapon() { //Arrange Axe axe = new Axe(1, 1); Dummy dummy = new Dummy(10, 10); //Act axe.Attack(dummy); //Assert Assert.That( () => axe.Attack(dummy), Throws .InvalidOperationException .With .Message .EqualTo("Axe is broken.")); Assert .Throws <InvalidOperationException>( () => axe.Attack(dummy)); Assert .Throws( typeof(InvalidOperationException), () => axe.Attack(dummy)); }
public void AxeLoosesDurabilityAfterAttack() { axe.Attack(dummy); int expectedDurability = durabilityPoints - 1; Assert.That(axe.DurabilityPoints, Is.EqualTo(expectedDurability), "Axe Durability doesn't change after attack."); }
public void AxeAttackWhenBroken() { systemUnderTest = new Axe(1, 1); systemUnderTest.Attack(dummy); Assert.Throws <InvalidOperationException>(() => systemUnderTest.Attack(dummy), "Axe is broken"); }
public static void Main(string[] args) { Axe axe = new Axe(10, 10); Dummy dummy = new Dummy(10, 100); axe.Attack(dummy); axe.Attack(dummy); }
public void DummyLosesHealthWhenAttacked() { dummy = new Dummy(10, 10); axe.Attack(dummy); Assert.AreEqual(9, dummy.Health, "Dummy does not lose health when attacked"); }
public void WhenDummyAttacked_ShouldLoseHealth() { int dummyHealth = dummy.Health; axe.Attack(dummy); Assert.That(dummy.Health, Is.EqualTo(dummyHealth - axe.AttackPoints)); }
public void AxeLoosesDurabilityAfterAttack() { axe.Attack(target); int expectedDurability = 1; Assert.That(axe.DurabilityPoints, Is.EqualTo(expectedDurability) , "Axe does not loose durability."); }
public void ABrokenAxeCantAttack() { Axe axe = new Axe(AxeAttack, 1); axe.Attack(this.dummy); Assert.That(() => axe.Attack(this.dummy), Throws.InvalidOperationException.With.Message.EqualTo("Axe is broken.")); }
public void AxeLosesDurabilityAfterAttack() { var expectedDurability = axe.AttackPoints - 1; axe.Attack(dummy); Assert.That(axe.DurabilityPoints, Is.EqualTo(expectedDurability)); }
public void AxeLosesDurabilityAfterAttack() { //Act axe.Attack(dummy); //Assert Assert.That(axe.DurabilityPoints, Is.EqualTo(1), "Axe Durability doesn't change after attack"); }
public void CheckIfAbleToAttackWithBrokenAxe() { Axe axe = new Axe(10, 1); axe.Attack(this.dummy); Assert.That(() => axe.Attack(this.dummy), Throws.InvalidOperationException.With.Message.EqualTo("Axe is broken.")); }
public void DeadDummyThrowsExceptionIfAttacked() { var axe = new Axe(20, 100); axe.Attack(this.dummy); Assert.That(() => axe.Attack(this.dummy), Throws.InvalidOperationException.With.Message.EqualTo("Dummy is dead.")); }
public void AxeAttackingWithBrokenWapon() { Axe axe = new Axe(10, 1); Dummy dummy = new Dummy(10, 10); axe.Attack(dummy); Assert.Catch <InvalidOperationException>(() => axe.Attack(dummy)); }
public void DummyIsAttackedWithBrokenWeapon() { Axe axe = new Axe(axeAttackPoints, secondTestAxeDurability); Dummy dummy = new Dummy(dummyHealth, dummyExperience); axe.Attack(dummy); Assert.That(() => axe.Attack(dummy), Throws.InvalidOperationException.With.Message.EqualTo("Axe is broken.")); }
// [Test] public void Attack_AttackWithBrokenAxe_ExceptionTrown() { var axe = new Axe(10, 1); // var dummy = new Dummy(10, 15); axe.Attack(dummy); Assert.That(() => axe.Attack(dummy), Throws.InvalidOperationException.With.Message.EqualTo("Axe is broken.")); }
public void BrokenAxeCantAttack() { axe = new Axe(2, 2); axe.Attack(dummy); axe.Attack(dummy); Assert.Throws <InvalidOperationException>((() => axe.Attack(dummy)), "Broken axes cannot attack"); }
public void DummyHasToLoseHealthIfAttacked() { var initialHealth = dummy.Health; axe.Attack(dummy); var afterAttackHealth = dummy.Health; Assert.IsTrue(initialHealth > afterAttackHealth, "Dummy does not loose health"); }
public void When_AxeDurabilityPointsAreZero_ShouldThrowException() { Axe axe = new Axe(5, 1); Dummy dummy = new Dummy(50, 10); axe.Attack(dummy); Assert.That(() => axe.Attack(dummy), Throws.InvalidOperationException.With.Message.EqualTo("Axe is broken.")); }
public void BrokenAxeCannotAttack() { Axe axe = new Axe(1, 2); Dummy dummy = new Dummy(10, 1); axe.Attack(dummy); axe.Attack(dummy); Assert.Throws <InvalidOperationException>(() => axe.Attack(dummy)); }
public void AtackWithBrokenWeapon() { Axe axe = new Axe(10, 0); Dummy dummy = new Dummy(10, 10); axe.Attack(dummy); Assert.Throws <InvalidOperationException>(() => axe.Attack(dummy)); }
public void AreDummyIsDead() { var axe = new Axe(10, 10); var dummy = new Dummy(10, 10); axe.Attack(dummy); Assert.Throws <InvalidOperationException>(() => axe.Attack(dummy)); }
public void BrokenAxeCantAttack() { Axe axe = new Axe(1, 1); Dummy dummy = new Dummy(10, 10); axe.Attack(dummy); Assert.That(() => axe.Attack(dummy), Throws.InvalidOperationException.With.Message.EqualTo("Axe is broken.")); }
public void DeadDummyThrowsExceptionIfAttacked() { Dummy dummy = new Dummy(5, 5); Axe axe = new Axe(10, 10); axe.Attack(dummy); Assert.Throws <InvalidOperationException>(() => axe.Attack(dummy), "Dead dummy does not throw exception when attacked."); }
public void AttackWithBrokenWeapon() { var axe = new Axe(1, 1); var dummy = new Dummy(20, 20); axe.Attack(dummy); Assert.Throws <InvalidOperationException>(() => axe.Attack(dummy)); }
public void DummyTests() { Axe axe = new Axe(8); Dummy dummy = new Dummy(1); axe.Attack(dummy); axe.Attack(dummy); axe.Attack(dummy); Assert.AreEqual(axe.DurabilityPoints, 9, "Axe Durability doesn't change after attack."); }
public void BrokenAxeCantAttack() { // Act axe.Attack(dummy); axe.Attack(dummy); // Assert var ex = Assert.Throws <InvalidOperationException>(() => axe.Attack(dummy)); Assert.That(ex.Message, Is.EqualTo("Axe is broken.")); }
public void BrokenAxeCantAtack() { Axe axe = new Axe(2, 2); Dummy dummy = new Dummy(20, 20); axe.Attack(dummy); axe.Attack(dummy); var ex = Assert.Throws <InvalidOperationException>(() => axe.Attack(dummy)); Assert.That(ex.Message, Is.EqualTo("Axe is broken.")); }