ExtractSyndicationFeedItems() public method

Extracts syndication feed items.
public ExtractSyndicationFeedItems ( Sdl.Web.Common.Configuration.Localization localization ) : IEnumerable
localization Sdl.Web.Common.Configuration.Localization The context .
return IEnumerable
        public void ExtractSyndicationFeedItems_Teasers_Success()
        {
            Localization testLocalization = TestFixture.ParentLocalization;
            Teaser testTeaser1 = new Teaser
            {
                Headline = "Test Teaser 1",
                Text = new RichText("This is the text of Test Teaser 1."),
                Link = new Link() { Url = "http://www.sdl.com/" }
            };
            Teaser testTeaser2 = new Teaser
            {
                Headline = "Test Teaser 2",
            };
            RegionModel testRegion1 = new RegionModel("test1");
            testRegion1.Entities.Add(testTeaser1);
            RegionModel testRegion2 = new RegionModel("test2");
            testRegion2.Entities.Add(testTeaser2);
            PageModel testPageModel = new PageModel("666");
            testPageModel.Regions.Add(testRegion1);
            testPageModel.Regions.Add(testRegion2);
            OutputJson(testPageModel);

            SyndicationItem[] syndicationItems = testPageModel.ExtractSyndicationFeedItems(testLocalization).ToArray();

            Assert.IsNotNull(syndicationItems);
            Assert.AreEqual(2, syndicationItems.Length, "syndicationItems.Length");

            SyndicationItem firstSyndicationItem = syndicationItems[0];
            Assert.IsNotNull(firstSyndicationItem, "firstSyndicationItem");
            Assert.IsNotNull(firstSyndicationItem.Title, "firstSyndicationItem.Title");
            Assert.IsNotNull(firstSyndicationItem.Summary, "firstSyndicationItem.Summary");
            Assert.IsNotNull(firstSyndicationItem.Links, "firstSyndicationItem.Links");
            Assert.AreEqual(testTeaser1.Headline, firstSyndicationItem.Title.Text, "firstSyndicationItem.Title.Text");
            Assert.AreEqual(testTeaser1.Text.ToString(), firstSyndicationItem.Summary.Text, "firstSyndicationItem.Summary.Text");
            Assert.AreEqual(1, firstSyndicationItem.Links.Count, "firstSyndicationItem.Links.Count");
            Assert.AreEqual(testTeaser1.Link.Url, firstSyndicationItem.Links[0].Uri.ToString(), "firstSyndicationItem.Links[0].Uri");

            SyndicationItem secondSyndicationItem = syndicationItems[1];
            Assert.IsNotNull(secondSyndicationItem, "secondSyndicationItem");
            Assert.IsNotNull(secondSyndicationItem.Title, "secondSyndicationItem.Title");
            Assert.IsNull(secondSyndicationItem.Summary, "secondSyndicationItem.Summary");
            Assert.IsNotNull(secondSyndicationItem.Links, "secondSyndicationItem.Links");
            Assert.AreEqual(testTeaser2.Headline, secondSyndicationItem.Title.Text, "secondSyndicationItem.Title.Text");
            Assert.AreEqual(0, secondSyndicationItem.Links.Count, "secondSyndicationItem.Links.Count");
        }
        public void ExtractSyndicationFeedItems_None_Success()
        {
            Localization testLocalization = TestFixture.ParentLocalization;
            PageModel testPageModel = new PageModel("666");
            OutputJson(testPageModel);

            SyndicationItem[] syndicationItems = testPageModel.ExtractSyndicationFeedItems(testLocalization).ToArray();

            Assert.IsNotNull(syndicationItems);
            Assert.AreEqual(0, syndicationItems.Length, "syndicationItems.Length");
        }