public void PointToWinGameTest(int pointsToWin) { SpaceTaxiBus.GetBus().RegisterEvent( GameEventFactory <object> .CreateGameEventForAllProcessors( GameEventType.GameStateEvent, this, "CHANGE_STATE", "GAME_RUNNING", "")); while (gameR.singletonScore.score != pointsToWin) { gameR.singletonScore.PointChanger("Add"); gameR.UpdateGameLogic(); gameR.RenderState(); } SpaceTaxiBus.GetBus().ProcessEventsSequentially(); Assert.That(stateMachine.ActiveState, Is.InstanceOf <GameWon>()); }
public void PlayerMoveRight(int timerToTest) { int i = 0; double xStartPostion = gameR.player.shape.Position.X; while (i < timerToTest) { gameR.currentVelocity = new Vec2F(0.01f, 0f); gameR.UpdateGameLogic(); gameR.RenderState(); i++; } double xEndPosition = gameR.player.shape.Position.X; Assert.That(xStartPostion < xEndPosition); }