BallInLevelTests BallUpdateStartsNewLevel 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 BallUpdateStartsNewLevel()
Examples

[Test, CloseAfterFirstFrame]
public void BallUpdateStartsNewLevel()
{
    if (!IsMockResolver)
        return; //ncrunch: no coverage
    Resolve<BallInLevel>();
    var level = Resolve<Level>();
    level.GetBrickAt(0.25f, 0.125f).IsVisible = false;
    level.GetBrickAt(0.75f, 0.125f).IsVisible = false;
    level.GetBrickAt(0.25f, 0.375f).IsVisible = false;
    level.GetBrickAt(0.75f, 0.375f).IsVisible = false;
    Assert.AreEqual(0, level.BricksLeft);
    Resolve<MockKeyboard>().SetKeyboardState(Key.Space, State.Pressing);
    AdvanceTimeAndUpdateEntities();
    Assert.AreNotEqual(0, level.BricksLeft);
}
See Also