Exemple #1
0
        public void ParseFromXml_SubtitleOnlyItunes_ReturnsExpected()
        {
            var text   = File.ReadAllText($@"{TestDataRoot}Invalid\samplefeed_subtitlemissing.xml");
            var doc    = XDocument.Parse(text).Root;
            var parser = new ShowParser();

            parser.ParseFromXml(doc);

            var show = parser.GetContent();

            show.Subtitle.Should().NotBeEmpty();
        }
Exemple #2
0
        public void ParseFromXml_Author_ReturnsExpected()
        {
            var text   = File.ReadAllText($@"{TestDataRoot}Invalid\samplefeed_authormissing.xml");
            var doc    = XDocument.Parse(text).Root;
            var parser = new ShowParser();

            parser.ParseFromXml(doc);

            var show = parser.GetContent();

            show.Author.Should().Be("CBC Radio");
        }
Exemple #3
0
        public void ParseFromXml_SubtitleOnlyDescription_ReturnsExpected()
        {
            var text   = File.ReadAllText($@"{TestDataRoot}Invalid\samplefeed_authormissing.xml");
            var doc    = XDocument.Parse(text).Root;
            var parser = new ShowParser();

            parser.ParseFromXml(doc);

            var show = parser.GetContent();

            show.Subtitle.Should().StartWith("CBC Radio's Leigh");
        }
Exemple #4
0
        public void ParseFromXml_ImageHrefAndUrl_PrefersHref()
        {
            var text   = File.ReadAllText($@"{TestDataRoot}Invalid\samplefeed_conversations.xml");
            var doc    = XDocument.Parse(text).Root;
            var parser = new ShowParser();

            parser.ParseFromXml(doc);

            var show = parser.GetContent();

            show.ImageLink.Should().Be("http://www.abc.net.au/cm/rimage/7950252-1x1-large.jpg?v=4");
        }
Exemple #5
0
        public void ParseFromXml_Tags_ReturnsExpected()
        {
            var text   = File.ReadAllText($@"{TestDataRoot}Invalid\samplefeed_tagsmissing.xml");
            var doc    = XDocument.Parse(text).Root;
            var parser = new ShowParser();

            parser.ParseFromXml(doc);

            var show = parser.GetContent();

            show.Tags.Should().BeEquivalentTo(new List <string>(new[] { "iTunes U", "Business", "Finance" }));
        }
Exemple #6
0
        public void ParseFromXml_ImageOnlyUrl_ReturnsExpected()
        {
            var text   = File.ReadAllText($@"{TestDataRoot}Invalid\samplefeed_imagemissing.xml");
            var doc    = XDocument.Parse(text).Root;
            var parser = new ShowParser();

            parser.ParseFromXml(doc);

            var show = parser.GetContent();

            show.ImageLink.Should().Be("http://www.blogtalkradio.com/img/btrbetalogo.gif");
        }
Exemple #7
0
        public void ParseFromXml_DescriptionSummaryAndDescription_PrefersSummary()
        {
            var text   = File.ReadAllText($@"{TestDataRoot}Valid\samplefeed1.xml");
            var doc    = XDocument.Parse(text).Root;
            var parser = new ShowParser();

            parser.ParseFromXml(doc);

            var show = parser.GetContent();

            show.Description.Should().StartWith("#justSayin");
        }
Exemple #8
0
        public void ParseFromXml_DescriptionOnlyDescription_ReturnsExpected()
        {
            var text   = File.ReadAllText($@"{TestDataRoot}Invalid\samplefeed_descriptionmissing.xml");
            var doc    = XDocument.Parse(text).Root;
            var parser = new ShowParser();

            parser.ParseFromXml(doc);

            var show = parser.GetContent();

            show.Description.Should().StartWith("Storytelling im Radio");
        }
Exemple #9
0
        public void ParseFromXml_DescriptionOnlySummary_ReturnsExpected()
        {
            var text   = File.ReadAllText($@"{TestDataRoot}Invalid\samplefeed_subtitlemissing.xml");
            var doc    = XDocument.Parse(text).Root;
            var parser = new ShowParser();

            parser.ParseFromXml(doc);

            var show = parser.GetContent();

            show.Description.Should().StartWith("\nWatch award-winning documentary videos");
        }
Exemple #10
0
        public void ParseFromXml_SubtitleDescriptionAndItunes_PrefersDescription()
        {
            var text   = File.ReadAllText($@"{TestDataRoot}Invalid\samplefeed_descriptionmissing.xml");
            var doc    = XDocument.Parse(text).Root;
            var parser = new ShowParser();

            parser.ParseFromXml(doc);

            var show = parser.GetContent();

            show.Subtitle.Should().StartWith("Storytelling im Radio");
        }
Exemple #11
0
        public void ParseFromXml_WithNoContents_HasEmptyContent()
        {
            var doc    = XDocument.Parse("<xml></xml>").Root;
            var parser = new ShowParser();

            parser.ParseFromXml(doc);

            var show = parser.GetContent();

            show.Title.Should().BeNull();
            show.WebLink.Should().BeNull();
            show.ImageLink.Should().BeNull();
            show.Subtitle.Should().BeNull();
            show.Description.Should().BeNull();
            show.Author.Should().BeNull();
            show.Language.Should().BeNull();
            show.Tags.Should().BeNull();
        }
Exemple #12
0
        public void ParseFromXml_WithContents_ReturnsExpected()
        {
            var text   = File.ReadAllText($@"{TestDataRoot}Valid\samplefeed1.xml");
            var doc    = XDocument.Parse(text).Root;
            var parser = new ShowParser();

            parser.ParseFromXml(doc);

            var show = parser.GetContent();

            show.Title.Should().Be("#JustSayin");
            show.WebLink.Should().Be("https://justsayinpodcast.wordpress.com");
            show.ImageLink.Should().Be("http://justsayinpodcast.files.wordpress.com/2015/07/cropped-podcast-logo.jpg");
            show.Subtitle.Should().Be("A Comedy Podcast");
            show.Description.Should().Be("#justSayin is a random comedy podcast, with Boston accents and a variety of subjects.");
            show.Author.Should().Be("Ryan & Tara");
            show.Language.Should().Be("en");
            show.Tags.Should().BeEquivalentTo(new List <string>(new[] { "Comedy", "Entertainment", "Boston", "Massachusetts", "Random", "Arts", "Performing Arts", "Games & Hobbies", "Video Games" }));
        }