Example #1
0
        public static void Test()
        {
            INewsUpdater        blekkoUpdater = new BlekkoChinaUpdater();
            List <INewsUpdater> newsSources   = new List <INewsUpdater>();

            newsSources.Add(blekkoUpdater);
            NewsReader nr = new NewsReader(newsSources);

            // nr.ReadAllNews();
        }
Example #2
0
        public void NewsSourcesTest()
        {
            INewsUpdater bbcNews = new MockBBC();
            INewsUpdater googNews = new MockGoogle();
            List<INewsUpdater> newsSources = new List<INewsUpdater>();
            newsSources.Add(bbcNews);
            newsSources.Add(googNews);
            NewsReader nr = new NewsReader(newsSources);
            List<NewsItem> allNews = nr.ReadAllNews();

            bool found = false;
            foreach (NewsItem n in allNews)
            {
                if (n.Title == "title3goog")
                {
                    found = true;
                }
            }

            Assert.IsTrue(found);
        }