internal static IEnumerable <SearchResult> BySource(CompendiumSource source) { string url = String.Format(SearchUrl, source.Value); XmlData xmlData = new XmlData(url); return(AnalyzeDoc(xmlData.XmlDoc)); }
public void TrapBySourceTest() { CompendiumSource source = new CompendiumSource { Value = 202 }; IEnumerable<SearchResult> actual; actual = SearchResultTrap.BySource(source); Assert.AreEqual(16, actual.Count()); Assert.IsTrue(actual.Any(x => x.Name == "Dust Funnel")); }
public void MonsterBySourceTest() { CompendiumSource source = new CompendiumSource {Value = 203}; IEnumerable<SearchResult> actual; actual = SearchResultMonster.BySource(source); Assert.AreEqual(5,actual.Count()); Assert.IsTrue(actual.Any(x=>x.Name=="Erdlu")); }
public void ItemBySourceTest() { CompendiumSource source = new CompendiumSource { Value = 14,Name="Arcane Power" }; IEnumerable<SearchResult> actual; actual = SearchResultMagicItem.BySource(source); Assert.AreEqual(9, actual.Count()); Assert.IsTrue(actual.Any(x => x.Name == "Magic Tome")); }
private static IEnumerable<CompendiumSource> AnalyzeDoc(XmlDocument doc) { List<CompendiumSource> l = new List<CompendiumSource>(); XmlNodeList nodes = doc.SelectNodes("//Option");// SelectNodes("//Option[type='MonsterSourceBook']"); foreach (XmlNode node in nodes) { CompendiumSource cs = new CompendiumSource { Name = node["val"].InnerText, Value = Convert.ToInt32(node["id"].InnerText), SourceType = node["type"].InnerText }; l.Add(cs); } AddDefaultSourceOption(l); return l; }
private static IEnumerable <CompendiumSource> AnalyzeDoc(XmlDocument doc) { List <CompendiumSource> l = new List <CompendiumSource>(); XmlNodeList nodes = doc.SelectNodes("//Option");// SelectNodes("//Option[type='MonsterSourceBook']"); foreach (XmlNode node in nodes) { CompendiumSource cs = new CompendiumSource { Name = node["val"].InnerText, Value = Convert.ToInt32(node["id"].InnerText), SourceType = node["type"].InnerText }; l.Add(cs); } AddDefaultSourceOption(l); return(l); }
protected virtual IEnumerable<SearchResult> GetSearchResults(CompendiumSource cs) { throw new NotImplementedException(); }
internal static IEnumerable<SearchResult> BySource(CompendiumSource source) { string url = String.Format(SearchUrl, source.Value); XmlData xmlData=new XmlData(url); return AnalyzeDoc(xmlData.XmlDoc); }
protected override IEnumerable<SearchResult> GetSearchResults(CompendiumSource cs) { return SearchResultMonster.BySource(cs); }