Inheritance Hierarchy
DeltaEngine.Platforms TestWithMocksOrVisually
Breakout.Tests ScoreTests
Namespace: Breakout.Tests
Assembly: Breakout.Tests (in Breakout.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The ScoreTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
![]() | ScoreTests | Initializes a new instance of the ScoreTests class |
Methods
Name | Description | |
---|---|---|
![]() | AdvanceTimeAndUpdateEntities | (Inherited from TestWithMocksOrVisually.) |
![]() | IncreasePoints | |
![]() | Init | |
![]() | InitializeResolver | (Inherited from TestWithMocksOrVisually.) |
![]() | LoseLivesUntilGameOver | |
![]() | NextLevelWithLevelInitialization | |
![]() | NextLevelWithoutInitialization | |
![]() | 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 IncreasePoints() { Assert.IsTrue(score.ToString().Contains("Score: 0"), score.ToString()); score.IncreasePoints(); }
[Test] public void NextLevelWithoutInitialization() { bool isGameOver = false; score.GameOver += () => isGameOver = true; Assert.AreEqual(1, score.Level); score.NextLevel(); Assert.AreEqual(2, score.Level); Assert.IsFalse(isGameOver); }
[Test] public void NextLevelWithLevelInitialization() { Resolve<Level>(); bool isGameOver = false; score.GameOver += () => isGameOver = true; Assert.AreEqual(1, score.Level); score.NextLevel(); Assert.AreEqual(2, score.Level); Assert.IsFalse(isGameOver); }
[Test] public void LoseLivesUntilGameOver() { bool isGameOver = false; score.GameOver += () => isGameOver = true; score.LifeLost(); score.LifeLost(); score.LifeLost(); Assert.IsTrue(isGameOver); }
See Also