protected override bool FoundInLibrary(Library lib, SearchResult searchResult)
        {
            bool             duplicate = false;
            SearchResultTrap srm       = searchResult as SearchResultTrap;
            Trap             c         = lib.FindTrapCaseInsensitive(srm.Name, Convert.ToInt32(srm.Level));

            if (c != null)
            {
                duplicate = false;
            }
            return(duplicate);
        }
        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"));
        }
        protected override bool IsInAnotherLibrary(SearchResult searchResult, Library current)
        {
            bool             duplicate = false;
            SearchResultTrap srm       = searchResult as SearchResultTrap;

            foreach (Library lib in _mpApp.Libraries)
            {
                if (lib.ID == current.ID)
                {
                    continue;
                }
                Trap c = lib.FindTrap(srm.Name, Convert.ToInt32(srm.Level), srm.Role);
                if (c != null)
                {
                    duplicate = true;
                }
            }
            return(duplicate);
        }
 protected override IEnumerable <SearchResult> GetSearchResults(CompendiumSource cs)
 {
     return(SearchResultTrap.BySource(cs));
 }