public void TestProcessSelectedState() { StateSystem stateSystem = new StateSystem(); MockState mock = new MockState(); stateSystem.AddState("mock", mock); stateSystem.ChangeState("mock"); stateSystem.Update(0); Assert.IsTrue(mock.HasProcessBeenCalled); }
public void TestProcessNoSelectedState() { StateSystem stateSystem = new StateSystem(); MockState mock = new MockState(); stateSystem.AddState("mock", mock); stateSystem.Update(0); // State wasn't changed to mock so it shouldn't be // processed. Assert.IsFalse(mock.HasProcessBeenCalled); }
void GameLoop(double elapsedTime) { _system.Update(elapsedTime); _system.Render(); _openGLControl.Refresh(); }