public void TestRenderSelectedState()
 {
     StateSystem stateSystem = new StateSystem();
     MockState mock = new MockState();
     stateSystem.AddState("mock", mock);
     stateSystem.ChangeState("mock");
     stateSystem.Render();
     // State wasn't changed to mock so it shouldn't be 
     // rendered.
     Assert.IsTrue(mock.HasRenderBeenCalled);
 }
        public void TestRenderNoSelectedState()
        {
            StateSystem stateSystem = new StateSystem();
            MockState   mock        = new MockState();

            stateSystem.AddState("mock", mock);
            stateSystem.Render();
            // State wasn't changed to mock so it shouldn't be
            // rendered.
            Assert.IsFalse(mock.HasRenderBeenCalled);
        }
        public void TestChangeStates()
        {
            StateSystem stateSystem = new StateSystem();
            MockState   mock1       = new MockState();
            MockState   mock2       = new MockState();

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