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")); }
public void GetHtmlTest_Trap() { HtmlData target = GetTarget(null, "trap"); HtmlDocument actual; actual = target.GetHtmlDocument(31); Assert.IsTrue(actual.DocumentNode.InnerText.Contains("Falling Iron Portcullis")); }
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); }
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); }
public void InvalidLoginPassword() { HtmlData target = GetTarget("toto", "monster"); HtmlDocument actual = target.GetHtmlDocument(4747); }