LevelTests BricksLeft 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 BricksLeft()
Examples

[Test, CloseAfterFirstFrame]
public void CheckEmptyLevel()
{
    Resolve<Paddle>();
    var level = Resolve<EmptyLevel>();
    Assert.IsNull(level.GetBrickAt(0.25f, 0.25f));
    Assert.IsNull(level.GetBrickAt(0.5f, 0.25f));
    Assert.IsNull(level.GetBrickAt(0.75f, 0.35f));
    Assert.AreEqual(0, level.BricksLeft);
}
[Test, CloseAfterFirstFrame]
public void RemoveBrick()
{
    var level = Resolve<Level>();
    Assert.AreEqual(4, level.BricksLeft);
    var brick = level.GetBrickAt(0.25f, 0.25f);
    Assert.IsTrue(brick.IsVisible);
    brick.IsVisible = false;
    Assert.AreEqual(3, level.BricksLeft);
    Assert.IsNull(level.GetBrickAt(0.25f, 0.25f));
}
[Test, CloseAfterFirstFrame]
public void BricksLeft()
{
    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);
}
See Also