public void CompleteKillQuestTest() { IQuest quest = new QuestKill(1, "Welcome", "First Quest", itemReward, statReward, enemy_0, 5); quest.AcceptQuest(hero); Assert.AreEqual(true, quest.Active); Assert.AreEqual(false, quest.IsComplete()); hero.Attack(enemy_0); hero.Attack(enemy_1); hero.Attack(enemy_2); hero.Attack(enemy_3); hero.Attack(enemy_4); Assert.AreEqual($"Kill Orc: 5/5", quest.GetConditions()); Assert.AreEqual(true, hero.CompleteQuest(quest)); Assert.AreEqual(hero.Inventory.Items.Count, 1); Assert.AreEqual(110f, ((RegenerationStat)hero.GetStat(StatType.Health)).MaxValue); Assert.AreEqual(105f, ((RegenerationStat)hero.GetStat(StatType.Energy)).MaxValue); Assert.AreEqual(105f, ((RegenerationStat)hero.GetStat(StatType.Stamina)).MaxValue); Assert.AreEqual(32f, hero.GetStat(StatType.Intelligence).Value); Assert.AreEqual(51f, hero.GetStat(StatType.Luck).Value); }
public void UpdateKillQuestTest() { IQuest quest = new QuestKill(1, "Welcome", "First Quest", itemReward, statReward, enemy_0, 5); quest.AcceptQuest(hero); Assert.AreEqual(true, quest.Active); Assert.AreEqual(false, quest.IsComplete()); hero.Attack(enemy_0); Assert.AreEqual($"Kill Orc: 1/5", quest.GetConditions()); hero.Attack(enemy_1); Assert.AreEqual($"Kill Orc: 2/5", quest.GetConditions()); hero.Attack(enemy_2); Assert.AreEqual($"Kill Orc: 3/5", quest.GetConditions()); hero.Attack(enemy_3); Assert.AreEqual($"Kill Orc: 4/5", quest.GetConditions()); Assert.AreEqual(false, hero.CompleteQuest(quest)); }
public void AcceptKillQuestTest() { IQuest quest = new QuestKill(1, "Welcome", "First Quest", itemReward, statReward, enemy_0, 5); quest.AcceptQuest(hero); Assert.AreEqual(1, hero.QuestList.Count); Assert.AreEqual(true, quest.Active); Assert.AreEqual(false, quest.IsComplete()); Assert.AreEqual($"Kill Orc: 0/5", quest.GetConditions()); }