Namespace: DeltaEngine.Input.Tests
Assembly: DeltaEngine.Input.Tests (in DeltaEngine.Input.Tests.dll) Version: 1.1.1.0 (1.1.1)
Assembly: DeltaEngine.Input.Tests (in DeltaEngine.Input.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Examples
[Test, CloseAfterFirstFrame] public void TestSpaceKeyPress() { bool isSpacePressed = false; new Command(() => isSpacePressed = true).Add(new KeyTrigger(Key.Space, State.Pressed)); Assert.IsFalse(isSpacePressed); if (mockKeyboard == null) return; //ncrunch: no coverage mockKeyboard.SetKeyboardState(Key.Space, State.Pressed); AdvanceTimeAndUpdateEntities(); Assert.IsTrue(isSpacePressed); Assert.IsTrue(mockKeyboard.IsAvailable); }
See Also