Namespace: Asteroids
Assembly: Asteroids (in Asteroids.exe) Version: 1.1.1.0 (1.1.1)
Tests: Asteroids.Tests.GameLogicTests
2 unit tests call Asteroids.Game.GameOver
Assembly: Asteroids (in Asteroids.exe) Version: 1.1.1.0 (1.1.1)
Syntax
Remarks
Examples
[Test, CloseAfterFirstFrame] public void PlayerShipAndAsteroidCollidingResultsInGameOver() { bool gameOver = false; interactionLogic.BeginGame(); interactionLogic.GameOver += () => { gameOver = true; }; interactionLogic.Player.Set(new Rectangle(Vector2D.Half, new Size(.05f))); interactionLogic.CreateAsteroidsAtPosition(Vector2D.Half, 1, 1); AdvanceTimeAndUpdateEntities(); Assert.IsTrue(gameOver); }
[Test, CloseAfterFirstFrame] public void GameOverResultsInSameStateEvenMultipleCalls() { CreateAndStartGame(); game.GameOver(); game.GameOver(); Assert.AreEqual(GameState.GameOver, game.GameState); Assert.IsFalse(game.InteractionLogic.Player.IsActive); }
See Also