WindowsKeyboardTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Platforms TestWithMocksOrVisually
    DeltaEngine.Input.Windows.Tests WindowsKeyboardTests

Namespace: DeltaEngine.Input.Windows.Tests
Assembly: DeltaEngine.Input.Windows.Tests (in DeltaEngine.Input.Windows.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public class WindowsKeyboardTests : TestWithMocksOrVisually

The WindowsKeyboardTests type exposes the following members.

Constructors

  NameDescription
Public methodWindowsKeyboardTests
Initializes a new instance of the WindowsKeyboardTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
Public methodCreateWindowsKeyboard
Public methodDisposeSetsUnavailable
Public methodInitializeResolver (Inherited from TestWithMocksOrVisually.)
Protected methodRegisterMock T  (Inherited from TestWithMocksOrVisually.)
Protected methodResolve T  (Inherited from TestWithMocksOrVisually.)
Protected methodRunAfterFirstFrame (Inherited from TestWithMocksOrVisually.)
Public methodRunTestAndDisposeResolverWhenDone (Inherited from TestWithMocksOrVisually.)
Public methodUpdateKeyboard
Public methodUpdateKeyStates
Top
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
Examples

[Test, CloseAfterFirstFrame]
public void UpdateKeyboard()
{
    var trigger = new KeyTrigger(Key.A);
    keyboard.Update(new[]{trigger});
[Test, CloseAfterFirstFrame]
public void DisposeSetsUnavailable()
{
    keyboard.Dispose();
    Assert.IsFalse(keyboard.IsAvailable);
}
[Test, CloseAfterFirstFrame]
public void UpdateKeyStates()
{
    var mockKeyboard = new MockWindowsKeyboard();
    mockKeyboard.SetPressedKey(Key.A);
    var triggerPressing = new KeyTrigger(Key.A);
    mockKeyboard.Update(new[] { triggerPressing });
See Also