public void CompleteGatherQuestTest() { IQuest quest = new QuestGather(1, "Welcome part 2", "Second Quest", itemReward, statReward, item_0, 5); quest.AcceptQuest(hero); Assert.AreEqual(true, quest.Active); Assert.AreEqual(false, quest.IsComplete()); hero.Interact(item_0); hero.Interact(item_1); hero.Interact(item_2); hero.Interact(item_3); hero.Interact(item_4); Assert.AreEqual($"Find iron: 5/5", quest.GetConditions()); Assert.AreEqual(hero.Inventory.Items.Count, 5); Assert.AreEqual(true, hero.CompleteQuest(quest)); Assert.AreEqual(hero.Inventory.Items.Count, 6); 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 AcceptGatherQuestTest() { IQuest quest = new QuestGather(1, "Welcome part 2", "Second Quest", itemReward, statReward, item_0, 5); quest.AcceptQuest(hero); Assert.AreEqual(1, hero.QuestList.Count); Assert.AreEqual(true, quest.Active); Assert.AreEqual(false, quest.IsComplete()); Assert.AreEqual($"Find iron: 0/5", quest.GetConditions()); }
public void AcceptManyQuestsTest() { IQuest quest_gather = new QuestGather(1, "Welcome part 2", "Second Quest", itemReward, statReward, item_0, 5); IQuest quest_kill = new QuestKill(1, "Welcome part 1", "First Quest", itemReward, statReward, enemy_0, 5); quest_gather.AcceptQuest(hero); quest_kill.AcceptQuest(hero); Assert.AreEqual(2, hero.QuestList.Count); Assert.AreEqual(true, quest_gather.Active); Assert.AreEqual(true, quest_kill.Active); }
public void UpdateGatherQuestTest() { IQuest quest = new QuestGather(1, "Welcome part 2", "Second Quest", itemReward, statReward, item_0, 5); quest.AcceptQuest(hero); Assert.AreEqual(true, quest.Active); Assert.AreEqual(false, quest.IsComplete()); hero.Interact(item_0); Assert.AreEqual($"Find iron: 1/5", quest.GetConditions()); hero.Interact(item_1); Assert.AreEqual($"Find iron: 2/5", quest.GetConditions()); hero.Interact(item_2); Assert.AreEqual($"Find iron: 3/5", quest.GetConditions()); hero.Interact(item_3); Assert.AreEqual($"Find iron: 4/5", quest.GetConditions()); Assert.AreEqual(false, hero.CompleteQuest(quest)); }