BallTests ReleaseBallTwice 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 ReleaseBallTwice()
Examples

[Test, CloseAfterFirstFrame]
public void ReleaseBallTwice()
{
    if (!IsMockResolver)
        return; //ncrunch: no coverage 
    var ball = Resolve<TestBall>();
    Resolve<Paddle>();
    Resolve<MockKeyboard>().SetKeyboardState(Key.Space, State.Pressing);
    AdvanceTimeAndUpdateEntities(0.01f);
    Vector2D velocity = ball.CurrentVelocity;
    Resolve<MockKeyboard>().SetKeyboardState(Key.Space, State.Pressing);
    AdvanceTimeAndUpdateEntities(0.01f);
    Assert.AreEqual(velocity, ball.CurrentVelocity);
}
See Also