public void TestThatIgnoringTroopCharactersWorks() { _settings.UnitCountMode = UnitCountMode.Spec; _settings.BearerToTroopRatio = 10; var basicInfantryType1 = CharacterFactory.GetBasicInfantry(); var basicInfantryType2 = CharacterFactory.GetBasicInfantry(); var basicInfantryType3 = CharacterFactory.GetBasicInfantry(); var archer = CharacterFactory.GetArcher(); _sut.FilterAllowedBearerTypes(new List <IBMBCharacter>(new[] { archer, basicInfantryType1, basicInfantryType2, basicInfantryType3 })); var party = new PartyBuilder("testParty") .AddTroops(basicInfantryType1, 7) .AddTroops(basicInfantryType2, 8) .AddTroops(basicInfantryType3, 8) .AddTroops(archer, 20) .Build(); int bannersAdded = ProcessAgents(party); AssertBannerAddedTimes(2, bannersAdded); }
public void TestMixedTroops() { var basicInfantry = CharacterFactory.GetBasicInfantry(); var archer = CharacterFactory.GetArcher(); _sut.FilterAllowedBearerTypes(new List <IBMBCharacter>(new [] { archer, basicInfantry })); var party = new PartyBuilder("testParty") .AddTroops(basicInfantry, 21) .AddTroops(archer, 14) .Build(); int bannersAdded = ProcessAgents(party); AssertBannerAddedTimes(3, bannersAdded); }
public void TestThatSiegeDefendersDontGetBanners() { var basicInfantryType1 = CharacterFactory.GetBasicInfantry(); var archer = CharacterFactory.GetArcher(); _sutSiege.FilterAllowedBearerTypes(new List <IBMBCharacter>(new[] { archer, basicInfantryType1 })); var party = new PartyBuilder("testParty", false) .AddTroops(basicInfantryType1, 30) .AddTroops(archer, 20) .Build(); int bannersAdded = ProcessAgents(party, MissionType.Siege); AssertBannerAddedTimes(0, bannersAdded); }
public void TestMixedTroops() { var basicInfantry = CharacterFactory.GetBasicInfantry(); var archer = CharacterFactory.GetArcher(); _sut.FilterAllowedBearerTypes(new List <ICharacter>(new [] { archer, basicInfantry }), false); var party = new PartyBuilder("testParty") .AddTroops(basicInfantry, 21) .AddTroops(archer, 14) .Build(); foreach (var agent in party) { _sut.ProcessAgentOnBuild(agent, BattleType.FieldBattle); } Assert.Equal(3, _sut.AgentsThatShouldReceiveBanners.Count()); }
public void TestTwoParties() { var basicInfantry = CharacterFactory.GetBasicInfantry(); var archer = CharacterFactory.GetArcher(); _sut.FilterAllowedBearerTypes(new List <IBMBCharacter>(new[] { archer, basicInfantry })); var firstParty = new PartyBuilder("firstParty") .AddTroops(basicInfantry, 21) .AddTroops(archer, 14) .Build(); var secondParty = new PartyBuilder("secondParty") .AddTroops(basicInfantry, 14) .AddTroops(archer, 14) .Build(); int bannersAdded = ProcessAgents(firstParty.Concat(secondParty)); AssertBannerAddedTimes(5, bannersAdded); }