public void GetGroupingCorrectlyReturnsShadeGrouping_NoMaxLevel([Range(1, 4)] int numberEnemies, [Range(1, 3)] int fighterLevel) { ShadeGroupingConfiguration config = new ShadeGroupingConfiguration(numberEnemies, fighterLevel); ShadeFighterGrouping grouping = _factory.GetGrouping(config) as ShadeFighterGrouping; Assert.NotNull(grouping); List <Shade> shades = grouping.GetShades(); Assert.AreEqual(numberEnemies, shades.Count, $"There should be {numberEnemies} shades in the returned grouping"); Assert.True(shades.TrueForAll(s => s.Level == fighterLevel)); }
public void BattleManagerCorrectlyExecutesBellSealingMove() { //Arrange List <Shade> shades = _shadeGrouping.GetShades(); _humanFighter.SetSpeed(shades[0].Speed + 1); List <Bell> bells = GetBells(BellType.Copper, BellType.Silver); _input.Push("special", "pray copper", "1", "run", "y"); _chanceService.PushEventOccurs(true); //sealing is effective int attackIndex = shades[0].AvailableMoves.FindIndex(am => am.MoveType == BattleMoveType.Attack); _chanceService.PushWhichEventsOccur(attackIndex, attackIndex, attackIndex); _chanceService.PushEventsOccur(false, false); //both remaining shades will attack //Act _battleManager.Battle(_humanTeam, _shadeTeam, bells.Cast <TerrainInteractable>().ToList()); //Assert //1st shade was sealed Assert.AreEqual(0, shades[0].CurrentHealth); //other shades did not absorb its power Assert.AreEqual(1, shades[1].ShadeExperience); Assert.AreEqual(1, shades[2].ShadeExperience); }
public void GetGroupingCorrectlyReturnsShadeGrouping_LevelRange([Range(1, 3)] int minLevel, [Range(1, 3)] int levelDiff) { //Arrange int maxLevel = minLevel + levelDiff; int numberFighters = levelDiff + 1; ShadeGroupingConfiguration config = new ShadeGroupingConfiguration(numberFighters, minLevel, maxLevel); for (int i = 0; i < numberFighters; ++i) { _chanceService.PushWhichEventOccurs(i); } //Act ShadeFighterGrouping grouping = _factory.GetGrouping(config) as ShadeFighterGrouping; //Assert Assert.NotNull(grouping); List <Shade> shades = grouping.GetShades(); for (int i = 0; i < numberFighters; ++i) { Assert.AreEqual(minLevel + i, shades[i].Level); } }