Example #1
0
        private void SetCurrentWaveToBeClear()
        {
            IMonsterWave mockWave = Substitute.For <IMonsterWave>();

            mockWave.IsCleared().Returns(true);
            systemUnderTest.CurrentWave = mockWave;
        }
Example #2
0
        public void AfterProcessingMove_CurrentWaveIsCheckedToBeClear()
        {
            IMonsterWave mockWave = Substitute.For <IMonsterWave>();

            systemUnderTest.CurrentWave = mockWave;
            systemUnderTest.ProcessPlayerMove(Substitute.For <IGamePlayer>(), new List <IGamePiece>());

            mockWave.Received().IsCleared();
        }
Example #3
0
        public void GetLongestComboFromCurrentWave_ReturnsExpectedValue()
        {
            IMonsterWave mockWave = Substitute.For <IMonsterWave>();

            mockWave.GetLongestCombo().Returns(11);
            systemUnderTest.CurrentWave = mockWave;

            Assert.AreEqual(11, systemUnderTest.GetLongestComboFromCurrentWave());
        }
Example #4
0
        public void WhenManagerTicks_CurrentWaveTicks()
        {
            IMonsterWave mockWave = Substitute.For <IMonsterWave>();

            systemUnderTest.CurrentWave = mockWave;

            systemUnderTest.Tick(1);

            mockWave.Received().Tick(1);
        }
Example #5
0
        public void DoesMoveMatchAnyCurrentMonsters_ReturnsCurrentWaveValue()
        {
            List <IGamePiece> mockMove = new List <IGamePiece>();
            IMonsterWave      mockWave = Substitute.For <IMonsterWave>();

            systemUnderTest.CurrentWave = mockWave;

            systemUnderTest.DoesMoveMatchAnyCurrentMonsters(mockMove);

            mockWave.Received().DoesMoveMatchAnyCurrentMonsters(mockMove);
        }
Example #6
0
        public void WhenProcessingPlayerMove_CurrentWaveIsProcessed()
        {
            IGamePlayer       mockPlayer = Substitute.For <IGamePlayer>();
            List <IGamePiece> mockMove   = new List <IGamePiece>();
            IMonsterWave      mockWave   = Substitute.For <IMonsterWave>();

            systemUnderTest.CurrentWave = mockWave;

            systemUnderTest.ProcessPlayerMoveOnCurrentWave(mockPlayer, mockMove);

            mockWave.Received().ProcessPlayerMove(mockPlayer, mockMove);
        }
Example #7
0
        private IMonsterWave PopCurrentMonsterWave()
        {
            if (RemainingWaves.Count > 0)
            {
                IMonsterWave currentWave = RemainingWaves[0];
                mRemainingWaves.RemoveAt(0);

                return(currentWave);
            }
            else
            {
                return(null);
            }
        }
Example #8
0
        public void AfterProcessingPlayerMove_IfRemainingWave_NewWaveEventIsSent()
        {
            SetCurrentWaveToBeClear();
            IMonsterWave mockNextWave = Substitute.For <IMonsterWave>();

            systemUnderTest.RemainingWaves = new List <IMonsterWave>()
            {
                mockNextWave
            };

            systemUnderTest.ProcessPlayerMove(Substitute.For <IGamePlayer>(), new List <IGamePiece>());

            MessageService.Received().Send(GameMessages.NEW_MONSTER_WAVE_EVENT);
        }
Example #9
0
        public void AfterProcessingPlayerMove_IfRemainingWave_GameManagerGetsPrepared()
        {
            SetCurrentWaveToBeClear();
            IMonsterWave mockNextWave = Substitute.For <IMonsterWave>();

            systemUnderTest.RemainingWaves = new List <IMonsterWave>()
            {
                mockNextWave
            };

            systemUnderTest.ProcessPlayerMove(Substitute.For <IGamePlayer>(), new List <IGamePiece>());

            GameManager.Received().PrepareForNextWave();
        }
Example #10
0
        public void AfterProcessingPlayerMove_IfRemainingWave_WaveIsMadeCurrentAndPrepared()
        {
            SetCurrentWaveToBeClear();
            IMonsterWave mockNextWave = Substitute.For <IMonsterWave>();

            systemUnderTest.RemainingWaves = new List <IMonsterWave>()
            {
                mockNextWave
            };

            systemUnderTest.ProcessPlayerMove(Substitute.For <IGamePlayer>(), new List <IGamePiece>());

            Assert.AreEqual(mockNextWave, systemUnderTest.CurrentWave);
            mockNextWave.Received().Prepare();
            Audio.Received().PlayOneShot(CombatAudioKeys.START_NEXT_WAVE);
        }