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

            game.ShipDestroyed();

            gameView.Received(1).GameOver();
        }
Beispiel #2
0
        public void CanLoseLives()
        {
            GameCtrl game = new GameCtrl(
                Substitute.For <IGameView> (), Substitute.For <IShipCtrl> ()
                );
            int initLives = game.GameState.Lives;

            game.ShipDestroyed();

            Assert.AreEqual(game.GameState.Lives, initLives - 1);
        }
Beispiel #3
0
        public void CanRespawnShip()
        {
            var gameView = Substitute.For <IGameView> ();
            var ship     = Substitute.For <IShipCtrl> ();

            gameView.WaitToRespawnShip(Arg.Invoke());
            GameCtrl game = new GameCtrl(gameView, ship);

            game.ShipDestroyed();

            ship.Received(1).Respawn();
        }