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

[Test, CloseAfterFirstFrame]
public void ReflectBall()
{
    if (!IsMockResolver)
        return; //ncrunch: no coverage 
    var ball = Resolve<Ball>();
    var keyboard = Resolve<MockKeyboard>();
    keyboard.SetKeyboardState(Key.Space, State.Pressing);
    keyboard.SetKeyboardState(Key.CursorRight, State.Pressing);
    ball.DrawArea = Rectangle.FromCenter(new Vector2D(0.1f, 0.2f), ball.Size);
    AdvanceTimeAndUpdateEntities(0.1f);
    Assert.AreNotEqual(0.5f, ball.Position.X);
}
See Also