public void FirstAddedIsSetAsDefault() { var stageCollection = new GameStageRegistry(); stageCollection.RegisterStage <MockGameStage>(); stageCollection.RegisterStage <DummyGameStage>(); Assert.AreEqual(stageCollection.Default, typeof(MockGameStage)); }
public void CanRegisterStages() { var stageCollection = new GameStageRegistry(); stageCollection.RegisterStage <MockGameStage>("stage1"); Assert.AreEqual(typeof(MockGameStage), stageCollection["stage1"]); stageCollection.RegisterStage <DummyGameStage>("stage2"); Assert.AreEqual(typeof(DummyGameStage), stageCollection["stage2"]); }
public void LoadsFirstStageInCollectionByDefault() { var dummyInput = new Input(); var stageCollection = new GameStageRegistry(); stageCollection.RegisterStage <MockGameStage>(); stageCollection.RegisterStage <DummyGameStage>(); var gameStageMgr = new GameStageManager(dummyInput, stageCollection); gameStageMgr.Initialize(new MockGameResourceFactory()); Assert.IsInstanceOfType(gameStageMgr.ActiveGameStage, typeof(MockGameStage)); }
public void UsesTypeNameAsKeyIfNoKeyIsProvided() { var stageCollection = new GameStageRegistry(); stageCollection.RegisterStage <MockGameStage>(); Assert.AreEqual(typeof(MockGameStage), stageCollection["MockGameStage"]); }
public void RegisterStages(GameStageRegistry stages) { stages.RegisterStage <DummyGameStage>(); TypeOfStageRegistered = typeof(DummyGameStage); RegisterStagesWasInvoked = true; ProvidedGameStageCollection = stages; }
public void GameStageManagerIsAssignedToGameStageDuringInitialize() { var dummyInput = new Input(); var stageCollection = new GameStageRegistry(); stageCollection.RegisterStage <MockGameStage>(); var gameStageMgr = new GameStageManager(dummyInput, stageCollection); gameStageMgr.Initialize(new MockGameResourceFactory()); Assert.AreSame(gameStageMgr.ActiveGameStage.GameStageManager, gameStageMgr); }
public void InitializeIsInvokedOnGameStageWhenLoadedDuringInitialize() { var dummyInput = new Input(); var stageCollection = new GameStageRegistry(); stageCollection.RegisterStage <MockGameStage>(); var gameStageMgr = new GameStageManager(dummyInput, stageCollection); gameStageMgr.Initialize(new MockGameResourceFactory()); var stage = gameStageMgr.ActiveGameStage as MockGameStage; Assert.IsTrue(stage.InitializeWasInvoked); }
public void RegisterStages(GameStageRegistry registry) { registry.RegisterStage <MainMenuStage>(); registry.RegisterStage <GameplayStage>(); }