Beispiel #1
0
        public void CanSpawnSaucers()
        {
            GameCtrl game = new GameCtrl(
                Substitute.For <IGameView> (), Substitute.For <IShipCtrl> ()
                );

            game.SpawnSaucer();

            Assert.NotNull(game.Saucer);
        }
Beispiel #2
0
        public void CanFinishLevelAfterSaucerDead()
        {
            var gameView = Substitute.For <IGameView> ();

            gameView.LevelFinished(Arg.Invoke());
            GameCtrl game = new GameCtrl(
                gameView, Substitute.For <IShipCtrl> ()
                );

            game.StartGame();

            Assert.AreEqual(game.GameState.Level, 1);

            game.SpawnSaucer();
            for (int i = 0; i < this.TotalAsteroids(1); i++)
            {
                game.AsteroidList [0].Destroyed();
            }
            game.Saucer.Destroyed();

            Assert.AreEqual(game.GameState.Level, 2);
        }