Example #1
0
        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);
        }
Example #2
0
        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());
        }
Example #3
0
        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));
        }