public void ReloadAfterShotWithNoAmmo() { // Arrange var alien = new Alien(); var gun = new Raygun(); // Act while (gun.HasAmmo()) { gun.Shoot(alien); } gun.Shoot(alien); // Assert Assert.True(gun.HasAmmo()); }
public void HaveAmmoAfterReload() { // Arrange var alien = new Alien(); var gun = new Raygun(); // Act while (gun.HasAmmo()) { gun.Shoot(alien); } gun.Reload(); // Assert Assert.True(gun.HasAmmo()); }
public void TryShootDodgingBug() { Bug bug = new Bug(); //Raygun gun = new Raygun(); 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 TryShootBug() { Bug bug = new Bug (); Raygun gun = new Raygun (); gun.FireAt (bug); Assert.True (bug.IsDead ()); Assert.True (gun.HasAmmo ()); }
public void ReloadAfterXShots(int shotsCount, bool shouldReload) { // Arrange var alien = new Alien(); var gun = new Raygun(); // Act for (int i = 0; i < shotsCount; i++) { gun.Shoot(alien); } // Assert Assert.Equal(shouldReload, !gun.HasAmmo()); }
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()); }