public void TestDisposeUnloaded() { using ( LoadingScreenState <TestGameState> loadingScreen = new LoadingScreenState <TestGameState>(this.stateManager, this.testState) ) { loadingScreen.Initialize(); } }
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); }
public void TestStartLoadingSynchronously() { using ( LoadingScreenState <TestGameState> loadingScreen = new LoadingScreenState <TestGameState>(this.stateManager, this.testState) ) { loadingScreen.Initialize(); loadingScreen.StartLoading(); } }
public void TestStartLoadingMultipleTimes() { using ( LoadingScreenState <TestGameState> loadingScreen = new LoadingScreenState <TestGameState>(this.stateManager, this.testState) ) { loadingScreen.Initialize(); loadingScreen.StartLoading(); loadingScreen.StartLoading(); loadingScreen.StartLoading(); } }
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); } }
public void TestConstructor() { LoadingScreenState <TestGameState> loadingScreen = new LoadingScreenState <TestGameState>( this.stateManager, this.testState ); }