public async Task PerformanceTest_Valid_Feeds()
        {
            foreach (var feedFile in Directory.EnumerateFiles($@"{TestDataPath}\Valid", "*.xml"))
            {
                using (var feedStream = new FileStream(feedFile, FileMode.Open))
                    using (var reader = new StreamReader(feedStream))
                    {
                        var feedContents = reader.ReadToEnd();
                        reader.BaseStream.Position = 0;
                        var episodeCount = Regex.Matches(feedContents, "<item>").Count;

                        var feedReader = new FeedReader(reader, _logger);
                        await feedReader.SkipPreheader();

                        feedReader.ReadDocumentHeader();

                        var showXml = await feedReader.GetShowXmlAsync();

                        showXml.Should().NotBeNull();

                        XDocument episodeXml;
                        for (var episodeIndex = 0; episodeIndex < episodeCount; episodeIndex++)
                        {
                            episodeXml = await feedReader.GetNextEpisodeXmlAsync();

                            episodeXml.Should().NotBeNull("because we have {0} and there should be {1}", episodeIndex + 1, episodeCount);
                        }
                        episodeXml = await feedReader.GetNextEpisodeXmlAsync();

                        episodeXml.Should().BeNull();
                    }
            }
        }
        public async Task GetNextEpisodeAsync_NoMoreEpisodes_ReturnsNull()
        {
            var input = File.ReadAllText($@"{TestDataRoot}Invalid\samplefeed_nomoreepisodes.xml");

            using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(input)))
                using (var reader = new StreamReader(stream))
                {
                    var feedReader = new FeedReader(reader, _logger);
                    await feedReader.SkipPreheader();

                    feedReader.ReadDocumentHeader();
                    await feedReader.GetShowXmlAsync();

                    await feedReader.GetNextEpisodeXmlAsync();

                    var xml = await feedReader.GetNextEpisodeXmlAsync();

                    xml.Should().BeNull();
                }
        }
        public async Task GetNextEpisodeAsync_TooLongContent_Throws()
        {
            var input = File.ReadAllText($@"{TestDataRoot}Invalid\samplefeed_toolongcontent2.xml");

            FeedReader feedReader;

            using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(input)))
                using (var reader = new StreamReader(stream))
                {
                    feedReader = new FeedReader(reader, _logger);
                    await feedReader.SkipPreheader();

                    feedReader.ReadDocumentHeader();
                    await feedReader.GetShowXmlAsync();

                    Func <Task> act = async() => await feedReader.GetNextEpisodeXmlAsync();

                    await act.Should().ThrowAsync <InvalidPodcastFeedException>();
                }
        }