Example #1
0
        public void RemoveFeedThatIsNotInTheListDoesNothing()
        {
            FeedManager.ClearFeeds();

            Feed feed = new Feed();

            feed.Name = "sample feed";
            feed.Url  = "https://example.com";
            FeedManager.Add(feed);

            var before = FeedManager.GetFeeds();

            FeedManager.Remove(feed);

            var after = FeedManager.GetFeeds();

            Assert.AreEqual(before.Count(), after.Count(), "The number of feeds should be the same if an attempt is made to remove a feed that is not in the list.");
        }
Example #2
0
        public void AddedFeedAppearsinGetFeeds()
        {
            FeedManager.ClearFeeds();

            Feed feed = new Feed();

            feed.Name = "sample feed";
            feed.Url  = "https://example.com";
            FeedManager.Add(feed);

            var expected = FeedManager.GetFeeds();

            foreach (var item in expected)
            {
                if (item.Name.Equals(feed.Name, StringComparison.OrdinalIgnoreCase) &&
                    item.Url.Equals(feed.Url, StringComparison.OrdinalIgnoreCase))
                {
                    return;
                }
            }
            Assert.Fail("The feed was not returned by GetFeeds.");
        }