WaveTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Platforms TestWithMocksOrVisually
    GhostWars.Tests WaveTests

Namespace: GhostWars.Tests
Assembly: GhostWars.Tests (in GhostWars.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public class WaveTests : TestWithMocksOrVisually

The WaveTests type exposes the following members.

Constructors

  NameDescription
Public methodWaveTests
Initializes a new instance of the WaveTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
Public methodCreateWaveOnClick
Public methodGhostWaveFromLeftToRight
Public methodInitializeResolver (Inherited from TestWithMocksOrVisually.)
Public methodLetWaveReachItsTarget
Public methodMultipleWaves
Protected methodRegisterMock T  (Inherited from TestWithMocksOrVisually.)
Protected methodResolve T  (Inherited from TestWithMocksOrVisually.)
Protected methodRunAfterFirstFrame (Inherited from TestWithMocksOrVisually.)
Public methodRunTestAndDisposeResolverWhenDone (Inherited from TestWithMocksOrVisually.)
Top
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
Examples

[Test]
public void GhostWaveFromLeftToRight()
{
    CreateWave(true);
    AdvanceTimeAndUpdateEntities();
}
[Test]
public void CreateWaveOnClick()
{
    //ncrunch: no coverage start 
    new Command(Command.Click,
        pos => new GhostWave(new Vector2D(0.2f, 0.5f), pos, 5, Team.HumanYellow.ToColor()));
    //ncrunch: no coverage end
}
[Test]
public void MultipleWaves()
{
    new GhostWave(new Vector2D(0.2f, 0.5f), new Vector2D(0.8f, 0.5f), 5,
        Team.HumanYellow.ToColor());
    new GhostWave(new Vector2D(0.3f, 0.6f), new Vector2D(0.6f, 0.6f), 5,
        Team.ComputerTeal.ToColor());
    GameLogic.GhostSize = 0.8f;
    new GhostWave(new Vector2D(0.4f, 0.7f), new Vector2D(0.3f, 0.7f), 5,
        Team.ComputerTeal.ToColor());
}
[Test, CloseAfterFirstFrame]
public void LetWaveReachItsTarget()
{
    var targetReached = false;
    var wave = new GhostWave(Vector2D.Half, Vector2D.Half + new Vector2D(0.01f, 0.01f), 5,
        Team.ComputerPurple.ToColor());
    wave.TargetReached += (t1, t2) => targetReached = true;
    AdvanceTimeAndUpdateEntities(0.25f);
    Assert.IsTrue(targetReached);
    Assert.IsFalse(wave.IsActive);
}
See Also