private void SetCurrentWaveToBeClear() { IMonsterWave mockWave = Substitute.For <IMonsterWave>(); mockWave.IsCleared().Returns(true); systemUnderTest.CurrentWave = mockWave; }
public void AfterProcessingMove_CurrentWaveIsCheckedToBeClear() { IMonsterWave mockWave = Substitute.For <IMonsterWave>(); systemUnderTest.CurrentWave = mockWave; systemUnderTest.ProcessPlayerMove(Substitute.For <IGamePlayer>(), new List <IGamePiece>()); mockWave.Received().IsCleared(); }
public void GetLongestComboFromCurrentWave_ReturnsExpectedValue() { IMonsterWave mockWave = Substitute.For <IMonsterWave>(); mockWave.GetLongestCombo().Returns(11); systemUnderTest.CurrentWave = mockWave; Assert.AreEqual(11, systemUnderTest.GetLongestComboFromCurrentWave()); }
public void WhenManagerTicks_CurrentWaveTicks() { IMonsterWave mockWave = Substitute.For <IMonsterWave>(); systemUnderTest.CurrentWave = mockWave; systemUnderTest.Tick(1); mockWave.Received().Tick(1); }
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); }
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); }
private IMonsterWave PopCurrentMonsterWave() { if (RemainingWaves.Count > 0) { IMonsterWave currentWave = RemainingWaves[0]; mRemainingWaves.RemoveAt(0); return(currentWave); } else { return(null); } }
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); }
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(); }
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); }