Beispiel #1
0
        public void Parse_ShowHandler()
        {
            XElement element = fileAsXElement("XmlSamples\\ShowHandler.xml");
            var      matcher = HandlerXmlParser.ParseContentMatches(element).FirstOrDefault();

            Assert.IsTrue(matcher is ShowMatcher);
            Assert.IsTrue(matcher.Match("somethingDexterfaa"));
        }
        //TODO: refactor this away
        public RssDownloader ParseRssDownloader(XElement moduleElement)
        {
            string name               = moduleElement.Attribute("name").Value;
            string feedUrl            = moduleElement.Element("FeedUrl").Value;
            string torrentApplication = moduleElement.Element("TorrentApplicationPath").Value;

            List <IContentMatcher> matchers =
                HandlerXmlParser.ParseContentMatches(moduleElement.Element("MatchPatterns"));
            var matcher = new AnyMatcher(matchers);

            var downloader = new RssDownloader(name, torrentApplication, feedUrl, matcher);

            return(downloader);
        }