Inheritance Hierarchy
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
The WaveTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
WaveTests | Initializes a new instance of the WaveTests class |
Methods
Name | Description | |
---|---|---|
AdvanceTimeAndUpdateEntities | (Inherited from TestWithMocksOrVisually.) | |
CreateWaveOnClick | ||
GhostWaveFromLeftToRight | ||
InitializeResolver | (Inherited from TestWithMocksOrVisually.) | |
LetWaveReachItsTarget | ||
MultipleWaves | ||
RegisterMock T | (Inherited from TestWithMocksOrVisually.) | |
Resolve T | (Inherited from TestWithMocksOrVisually.) | |
RunAfterFirstFrame | (Inherited from TestWithMocksOrVisually.) | |
RunTestAndDisposeResolverWhenDone | (Inherited from TestWithMocksOrVisually.) |
Properties
Name | Description | |
---|---|---|
IsMockResolver | (Inherited from TestWithMocksOrVisually.) |
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