PaddleTests ControlPaddleVirtuallyWithMouse 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 ControlPaddleVirtuallyWithMouse()
Examples

[Test, CloseAfterFirstFrame]
public void ControlPaddleVirtuallyWithMouse()
{
    if (!IsMockResolver)
        return; //ncrunch: no coverage 
    var paddle = Resolve<Paddle>();
    var mouse = Resolve<MockMouse>();
    mouse.SetNativePosition(new Vector2D(0.45f, 0.76f));
    mouse.SetButtonState(MouseButton.Left, State.Pressed);
    AssertPaddleMovesLeftCorrectly(paddle);
    mouse.SetNativePosition(new Vector2D(0.55f, 0.76f));
    mouse.SetButtonState(MouseButton.Left, State.Released);
    mouse.SetButtonState(MouseButton.Left, State.Pressed);
    AssertPaddleMovesRightCorrectly(paddle);
}
See Also