Example #1
0
        public void GetHtmlTest_Creatures()
        {
            HtmlData     target = GetTarget(null, "monster");
            HtmlDocument actual;

            actual = target.GetHtmlDocument(4799);
            Assert.IsTrue(actual.DocumentNode.InnerText.Contains("Craud Impaler"));
            actual = target.GetHtmlDocument(2544);
            Assert.IsFalse(actual.DocumentNode.InnerText.Contains("Subscribe Now"));
            Assert.IsTrue(actual.DocumentNode.InnerText.Contains("Chaos Mauler"));
            actual = target.GetHtmlDocument(5869);
            Assert.IsTrue(actual.DocumentNode.InnerText.Contains("Vampiric Mist"));
        }
Example #2
0
        public void GetHtmlTest_Trap()
        {
            HtmlData     target = GetTarget(null, "trap");
            HtmlDocument actual;

            actual = target.GetHtmlDocument(31);
            Assert.IsTrue(actual.DocumentNode.InnerText.Contains("Falling Iron Portcullis"));
        }
Example #3
0
        public void GetAndLoad()
        {
            HtmlData     target = GetTarget(null, "monster");
            HtmlDocument actual;

            actual = target.GetHtmlDocument(5373);
            string creaturename = "Anakore Render";

            Assert.IsTrue(actual.DocumentNode.InnerText.Contains(creaturename));
            CreatureConverter cc = new CreatureConverter();
            Creature          c  = cc.GetMasterPlanObjectFromDoc(actual, Warning);

            Assert.AreEqual(c.Name, creaturename);
        }
Example #4
0
        protected override bool SpecificAddTo(ListViewItem lvi, bool log, HtmlData htmlData)
        {
            if (lvi.SubItems[2].Text.ToLower() == "no role" && lvi.SubItems[3].Text.ToLower() != "minion")
            {
                //  MessageBox.Show(String.Format("Creature {0} has No role, and is not a Minion !", lvi.Text), "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                ImportResult.WarningOn.Add(String.Format("{0} : no Role and is not a minion => Not Imported",
                                                         lvi.Text));
                return(false);
            }
            int id = Convert.ToInt32((lvi.Tag as SearchResult).ID);

            HtmlAgilityPack.HtmlDocument doc = htmlData.GetHtmlDocument(id);
            Creature c = Converter.GetMasterPlanObjectFromDoc(doc, ImportResult.WarningOn);

            CurrentLib.Creatures.Add(c);
            return(true);
        }
Example #5
0
 public void InvalidLoginPassword()
 {
     HtmlData     target = GetTarget("toto", "monster");
     HtmlDocument actual = target.GetHtmlDocument(4747);
 }