Exemplo n.º 1
0
        public void ReadItems_Should_Return_1_News_Items_From_AtomTest_Feed()
        {
            // Arrange
            XmlDocument xmlDoc = FakeXMLFeed.GetFakeXMLFeed("atomtest");
            AtomFeedParser rssFeedParser = new AtomFeedParser(xmlDoc);

            // Act
            var items = rssFeedParser.ReadItems();

            // Assert
            Assert.AreEqual(1, items.Count);
        }
Exemplo n.º 2
0
        public void ReadItems_Should_News_Items_With_Headline_Date_And_Link_From_Flimsy_Feed()
        {
            // Arrange
            XmlDocument xmlDoc = FakeXMLFeed.GetFakeXMLFeed("flimsy");
            AtomFeedParser rssFeedParser = new AtomFeedParser(xmlDoc);

            // Act
            var item = rssFeedParser.ReadItems()[0];

            // Assert
            Assert.IsNotNull(item.Headline, "Expected Headline");
            Assert.IsNotNull(item.Url, "Expected Url");
            Assert.IsNotNull(item.Summary, "Expected Summary");
            Assert.AreNotEqual(DateTime.MinValue, item.DatePublished);
        }