PaddleTests ControlPaddleVirtuallyWithKeyboard Method Delta Engine Documentation

Namespace: Breakout.Tests
Assembly: Breakout.Tests (in Breakout.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void ControlPaddleVirtuallyWithKeyboard()
Examples

[Test]
public void ControlPaddleVirtuallyWithKeyboard()
{
    if (!IsMockResolver)
        return; //ncrunch: no coverage
    Resolve<TestBall>();
    var paddle = Resolve<Paddle>();
    var keyboard = Resolve<MockKeyboard>();
    keyboard.SetKeyboardState(Key.CursorLeft, State.Pressed);
    AssertPaddleMovesLeftCorrectly(paddle);
    keyboard.SetKeyboardState(Key.CursorLeft, State.Released);
    keyboard.SetKeyboardState(Key.CursorRight, State.Pressed);
    AssertPaddleMovesRightCorrectly(paddle);
}
See Also