Exemple #1
0
        public void TestReeantrantPush()
        {
            using (var manager = new GameStateManager()) {
                var reentrant = new ReentrantGameState(manager);
                manager.Push(reentrant);

                // The reentrant game state pushes another game state onto the stack in its
                // OnEntered() notification. If this causes the stack to be built in the wrong
                // order, the ReentrantGameState would become the new active game state instead
                // of the sub-game-state it pushed onto the stack.
                Assert.AreNotSame(reentrant, manager.ActiveState);
            }
        }
    public void TestReeantrantPush() {
      GameStateManager manager = new GameStateManager(new GameServiceContainer());
      ReentrantGameState test = new ReentrantGameState(manager);
      
      manager.Push(test);

      // The reentrant game state pushes another game state onto the stack in its
      // OnEntered() notification. If this causes the stack to be built in the wrong
      // order, the ReentrantGameState would become the new active game state instead
      // of the sub-game-state it pushed onto the stack.
      Assert.AreNotSame(test, manager.ActiveState);
    }