public void QuestCardRunTest() { QuestMatch match = new QuestMatch(); //match has no story to start Assert.IsTrue(match.CurrentStory == null); BoarHunt boarhunt = new BoarHunt(match); // These tests are no longer relevant! //boarhunt.Run(); //match currentstory is initiated after quest.run //Assert.IsTrue(match.CurrentStory == boarhunt); //questFoes are initialized Assert.IsTrue(boarhunt.QuestFoes.Contains(typeof(Boar))); }
public void QuestTest() { QuestMatch match = new QuestMatch(logger: new Quest.Core.Logger("QuestTest")); Player p1 = new Player("p1", match); Player p2 = new Player("p2", match); Player p3 = new Player("p3", match); Player p4 = new Player("p4", match); match.AddPlayer(p1); match.AddPlayer(p2); match.AddPlayer(p3); match.AddPlayer(p4); QuestCard quest = new BoarHunt(match); match.CurrentStory = quest; quest.SponsorshipResponse(p1, true); Assert.IsTrue((match.CurrentStory as QuestCard).Sponsor == p1); quest.ParticipationResponse(p2, true); quest.ParticipationResponse(p3, true); quest.ParticipationResponse(p4, true); Assert.IsFalse(quest.Participants.Contains(p1)); Assert.IsTrue(quest.Participants.Contains(p2)); Assert.IsTrue(quest.Participants.Contains(p3)); Assert.IsTrue(quest.Participants.Contains(p4)); Boar boar = new Boar(match); Sword sword = new Sword(match); Horse horse = new Horse(match); p1.Hand.Add(new List <Card>() { boar, sword, horse }); quest.AddFoeStage(boar, new List <WeaponCard>() { sword, horse }); Assert.AreEqual(35, quest.GetStage(1).BattlePoints()); Thieves thieves = new Thieves(match); p1.Hand.Add(thieves); quest.AddFoeStage(thieves); Assert.AreEqual(5, quest.GetStage(2).BattlePoints()); p2.BattleArea.Add(new Sword(match)); p2.BattleArea.Add(new Excalibur(match)); p2.BattleArea.Add(new Dagger(match)); p2.BattleArea.Add(new Horse(match)); p2.BattleArea.Add(new Lance(match)); p2.BattleArea.Add(new BattleAx(match)); Assert.AreEqual(90, p2.BattleArea.BattlePoints()); p3.BattleArea.Add(new Dagger(match)); p3.BattleArea.Add(new Excalibur(match)); Assert.AreEqual(35, p3.BattleArea.BattlePoints()); p4.BattleArea.Add(new Sword(match)); Assert.AreEqual(10, p4.BattleArea.BattlePoints()); quest.Resolve(); Assert.AreEqual(2, quest.CurrentStage); Assert.IsTrue(quest.Participants.Contains(p2)); Assert.IsTrue(quest.Participants.Contains(p3)); Assert.IsFalse(quest.Participants.Contains(p4)); Assert.IsTrue(p2.BattleArea.Cards.Count == 0); Assert.IsTrue(p3.BattleArea.Cards.Count == 0); Assert.IsTrue(p4.BattleArea.Cards.Count == 0); p2.BattleArea.Add(new Dagger(match)); Assert.AreEqual(5, p2.BattleArea.BattlePoints()); quest.Resolve(); Assert.IsTrue(quest.Participants.Contains(p2)); Assert.IsFalse(quest.Participants.Contains(p3)); Assert.AreEqual(0, p1.Rank.Shields); Assert.AreEqual(2, p2.Rank.Shields); Assert.AreEqual(0, p3.Rank.Shields); Assert.AreEqual(0, p4.Rank.Shields); Assert.AreEqual(6, p1.Hand.Count); Assert.AreEqual(1, p2.Hand.Count); Assert.AreEqual(1, p3.Hand.Count); Assert.AreEqual(0, p4.Hand.Count); }