public void Manager_TerraformGameState_OneInvoke_Should_ProcessOnceOnly() { var mockState = TerraformMockHelpers.Setup_MockGameStateData_Targets(); var mockStateCurrent = TerraformMockHelpers.Setup_MockGameStateData_Elements(); var mockProcessedResult = new ProcessedTerraformingListResult() { newTargets = mockState, newValues = mockStateCurrent }; var gameDataHandlerMock = TerraformMockHelpers.SetupMock_IOrbitBodyTerraformDataHandler(mockState); var managerMock = TerraformMockHelpers.SetupMock_ITerraformingManager(mockProcessedResult); var gameState = new TerraformGameState(gameDataHandlerMock.Object, managerMock.Object); gameState.DoGameUpdate(); gameDataHandlerMock.Verify(m => m.GetAllPopulationsTerraformInfo(), Times.Once); managerMock.Verify(m => m.ProcessAll(It.IsAny <List <OrbitBodyWithTerraformInfo> >(), It.IsAny <List <OrbitBodyWithCurrentElementInfo> >(), 3600 * 24 * 5), Times.Once); gameDataHandlerMock.Verify(m => m.SetAllPopulationsTerraformInfo(mockState), Times.Once); }
/* ===================================================================================================================================================== * SIMULATION UI CODE FOLLOWS */ private void button_SimulateGameTick_Click(object sender, EventArgs e) { _terraformGameState.DoGameUpdate(); UpdateTargetList(); Update_listView_SimulateCurrentElements(); }