TilemapTests TestWithMockKeyboard Method Delta Engine Documentation

Namespace: DeltaEngine.Scenes.Tests.Controls
Assembly: DeltaEngine.Scenes.Tests (in DeltaEngine.Scenes.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void TestWithMockKeyboard()
Examples

[Test]
public void TestWithMockKeyboard()
{
    new ColoredLogoTilemap(World, Map);
    if (!IsMockResolver)
        return; //ncrunch: no coverage 
    var keyboard = Resolve<MockKeyboard>();
    keyboard.SetKeyboardState(Key.A, State.Pressed);
    AdvanceTimeAndUpdateEntities();
    keyboard.SetKeyboardState(Key.D, State.Pressed);
    AdvanceTimeAndUpdateEntities();
    keyboard.SetKeyboardState(Key.W, State.Pressed);
    AdvanceTimeAndUpdateEntities();
    keyboard.SetKeyboardState(Key.S, State.Pressed);
    AdvanceTimeAndUpdateEntities();
}
See Also