Exemplo n.º 1
0
 public void TestDisposeUnloaded()
 {
     using (
         LoadingScreenState <TestGameState> loadingScreen =
             new LoadingScreenState <TestGameState>(this.stateManager, this.testState)
         ) {
         loadingScreen.Initialize();
     }
 }
Exemplo n.º 2
0
        public void TestInitialize()
        {
            LoadingScreenState <TestGameState> loadingScreen =
                new LoadingScreenState <TestGameState>(this.stateManager, this.testState);

            Assert.AreEqual(0, testState.InitializeCallCount);
            loadingScreen.Initialize();
            Assert.AreEqual(1, testState.InitializeCallCount);
        }
Exemplo n.º 3
0
 public void TestStartLoadingSynchronously()
 {
     using (
         LoadingScreenState <TestGameState> loadingScreen =
             new LoadingScreenState <TestGameState>(this.stateManager, this.testState)
         ) {
         loadingScreen.Initialize();
         loadingScreen.StartLoading();
     }
 }
Exemplo n.º 4
0
 public void TestStartLoadingMultipleTimes()
 {
     using (
         LoadingScreenState <TestGameState> loadingScreen =
             new LoadingScreenState <TestGameState>(this.stateManager, this.testState)
         ) {
         loadingScreen.Initialize();
         loadingScreen.StartLoading();
         loadingScreen.StartLoading();
         loadingScreen.StartLoading();
     }
 }
Exemplo n.º 5
0
        public void TestGameStateSwitching()
        {
            using (
                LoadingScreenState <TestGameState> loadingScreen =
                    new LoadingScreenState <TestGameState>(this.stateManager, this.testState)
                ) {
                loadingScreen.Initialize();

                this.stateManager.Push(loadingScreen);
                Assert.AreSame(loadingScreen, this.stateManager.ActiveState);

                // Synchronous mode - loading finishes right here
                loadingScreen.StartLoading();

                // The loading screen may decide to do the switch in Update() or Draw() to
                // avoid thread synchronization issues.
                loadingScreen.Update(new GameTime());
                loadingScreen.Draw(new GameTime());

                // By now, the loading screen should have established the game state it was
                // loading as the new active state
                Assert.AreSame(this.testState, this.stateManager.ActiveState);
            }
        }
Exemplo n.º 6
0
 public void TestConstructor()
 {
     LoadingScreenState <TestGameState> loadingScreen = new LoadingScreenState <TestGameState>(
         this.stateManager, this.testState
         );
 }