public void TestFetchingRssFeed()
        {
            Console.WriteLine("Test to check if fetching a rss feed works.");
            bool wait = true;
            Rss  feed = new Rss("http://www.voyagerproject.org/feed/");

            feed.FeedUpdated += delegate(Rss updated_feed)
            {
                Console.WriteLine("");
                Console.WriteLine("Rss Feed fetched (" + updated_feed.Channels.Count + ")");
                wait = false;
            };
            feed.FetchFeed();
            Console.WriteLine("Waiting for data");
            DateTime start = DateTime.Now;

            while (wait)
            {
                if (DateTime.Now - start > new TimeSpan(0, 0, 35))
                {
                    Console.WriteLine("");
                    Console.WriteLine("Operation took too long");
                    wait = false;
                    Assert.Fail("Operation took too long");
                }
                Console.Write(".");
                System.Threading.Thread.Sleep(250);
            }
            Assert.IsTrue(feed.Channels.Count > 0, "no channels found.");
            Console.WriteLine("Fetching Rss Feed Test successful.");
        }
        public void TestUpdatingRssFeed()
        {
            Console.WriteLine("Test to check if updating a rss feed works.");
            bool wait      = true;
            int  items_num = 0;
            int  updates   = 0;
            Rss  feed      = new Rss("http://www.voyagerproject.org/feed/");

            feed.FeedUpdated += delegate(Rss updated_feed)
            {
                updates++;
                Console.WriteLine("");
                Console.WriteLine("Rss Feed fetched (" + updated_feed.Channels.Count + ")");
                items_num = updated_feed.Channels[0].Items.Count;
                updated_feed.FetchFeed();
                //wait = false;
            };
            feed.FetchFeed();
            Console.WriteLine("Waiting for data");
            DateTime start = DateTime.Now;

            while (wait)
            {
                if (DateTime.Now - start > new TimeSpan(0, 0, 2))
                {
                    Assert.IsTrue(feed.Channels.Count > 0, "no channels found.");
                    Assert.IsTrue(feed.Channels.Count == 1, "too many channels found.");
                    Assert.IsTrue(feed.Channels[0].Items.Count == items_num, "items num changed.");
                    wait = false;
                }
                Assert.IsTrue(updates <= 1, "too many updates.");
                Console.Write(".");
                System.Threading.Thread.Sleep(250);
            }
            Console.WriteLine("Updating Rss Feed Test successful.");
        }