public void TryShootDodgingBug() { bug.Dodge(); gun.FireAt(bug); bug.Dodge(); gun.FireAt(bug); bug.Dodge(); gun.FireAt(bug); Assert.IsFalse(bug.IsDead()); Assert.IsFalse(gun.HasAmmo()); }
public void TryShootDodgingBug() { Bug bug = new Bug(); PlassGun gun = new PlassGun(); bug.Dodge(); gun.FireAt(bug); bug.Dodge(); gun.FireAt(bug); bug.Dodge(); gun.FireAt(bug); Assert.IsFalse(bug.IsDead()); Assert.IsFalse(gun.HasAmmo()); }
public void TestBugDodges(bool didDodge, bool shouldBeDead) { Bug bug = new Bug (); Raygun gun = new Raygun (); if (didDodge) { bug.Dodge (); } gun.FireAt (bug); if (shouldBeDead) { Assert.True (bug.IsDead ()); } else { Assert.False (bug.IsDead ()); } }
public void NUnit_TestBugDodges(bool didDodge, bool shouldBeDead) { Bug bug = new Bug(); PlassGun gun = new PlassGun(); if (didDodge) { bug.Dodge(); } gun.FireAt(bug); if (shouldBeDead) { Assert.IsTrue(bug.IsDead()); } else { Assert.IsFalse(bug.IsDead()); } }