public void CanBeDestoyedAndRespawned() { ShipCtrl ship = new ShipCtrl(Substitute.For <IShipView> ()); ship.Destroyed(); Assert.False(ship.IsAlive); Assert.False(ship.IsActive); ship.Respawn(); Assert.True(ship.IsAlive); Assert.True(ship.IsActive); }
public void CannotReactWhileInactive() { var view = Substitute.For <IShipView> (); ShipCtrl ship = new ShipCtrl(view); ship.Destroyed(); ship.Thrust(); ship.Rotate(0); ship.Teleport(); view.DidNotReceive().Thrust(); view.DidNotReceive().Rotate(0); view.DidNotReceive().Teleport(Arg.Any <Action> ()); ship.Respawn(); ship.Thrust(); ship.Rotate(0); ship.Fire(); ship.Teleport(); view.Received(1).Thrust(); view.Received(1).Rotate(0); view.Received(1).Teleport(Arg.Any <Action> ()); }