コード例 #1
0
 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>());
 }
コード例 #2
0
        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);
        }