Ejemplo n.º 1
0
        public void UpdateAndCompleteCraftQuestTest()
        {
            IQuest quest = new QuestCraft(1, "Welcome part 3", "Craft Quest", itemReward, statReward, recept.Result, 1);

            quest.AcceptQuest(hero);

            Assert.AreEqual(true, quest.Active);
            Assert.AreEqual(false, quest.IsComplete());

            hero.Interact(recept);

            #region Gathering
            hero.Interact(new Resources(11, "iron", "resource item"));
            hero.Interact(new Resources(11, "iron", "resource item"));
            hero.Interact(new Resources(11, "iron", "resource item"));
            hero.Interact(new Resources(11, "iron", "resource item"));

            hero.Interact(new Resources(12, "wood", "resource item"));
            hero.Interact(new Resources(12, "wood", "resource item"));
            hero.Interact(new Resources(12, "wood", "resource item"));
            hero.Interact(new Resources(12, "wood", "resource item"));

            hero.Interact(new Resources(13, "coal", "resource item"));
            hero.Interact(new Resources(13, "coal", "resource item"));
            hero.Interact(new Resources(13, "coal", "resource item"));
            hero.Interact(new Resources(13, "coal", "resource item"));
            #endregion

            hero.Craft(recept);

            Assert.AreEqual($"Craft {recept.Result.Name}: 1/1", quest.GetConditions());

            Assert.AreEqual(true, hero.CompleteQuest(quest));
        }
Ejemplo n.º 2
0
        public void AcceptCraftQuestTest()
        {
            IQuest quest = new QuestCraft(1, "Welcome part 3", "Craft Quest", itemReward, statReward, recept.Result, 1);

            quest.AcceptQuest(hero);

            Assert.AreEqual(1, hero.QuestList.Count);
            Assert.AreEqual(true, quest.Active);
            Assert.AreEqual(false, quest.IsComplete());
            Assert.AreEqual($"Craft {recept.Result.Name}: 0/1", quest.GetConditions());
        }
Ejemplo n.º 3
0
        public void CreateCraftQuestTest()
        {
            IQuest quest = new QuestCraft(1, "Welcome part 3", "Craft Quest", itemReward, statReward, recept.Result, 1);

            Assert.AreEqual(1, quest.Id);

            Assert.AreEqual("Welcome part 3", quest.Title);
            Assert.AreEqual("Craft Quest", quest.Description);
            Assert.AreEqual(1, quest.Items.Count);
            Assert.AreEqual(1, quest.Items[0].Id);
            Assert.AreEqual("Helm of Fire", quest.Items[0].Name);
            Assert.AreEqual(5, quest.Stats.Count);
            Assert.AreEqual(QuestType.Craft, quest.Type);
            Assert.AreEqual(false, quest.Active);
        }