public void ParseWithoutCrashing(SampleFeed embeddedDocument)
        {
            // arrange
            var document = embeddedDocument.JsonDocument;

            // action
            // ReSharper disable once UnusedVariable
            var tryParseResult = JsonFeedParser.TryParseJsonFeed(document, out var parsedFeed);

            // assert
            Assert.True(tryParseResult);
        }
        public void ParseSampleFeedWithBlueShedSampleExtension(SampleFeed embeddedDocument)
        {
            // arrange
            var document1 = embeddedDocument.JsonDocument;

            // action
            var tryParseResult = JsonFeedParser.TryParseJsonFeed(document1, out var feed, new ExtensionManifestDirectory {
                new BlueShedSampleExtensionManifest()
            });

            Assert.True(tryParseResult);

            // assert
            Assert.Equal(1, feed.Extensions.Count);
            var blueShedExtension = (BlueShedSampleExtension)feed.Extensions.SingleOrDefault(x => x is BlueShedSampleExtension);

            Assert.NotNull(blueShedExtension);
            Assert.Equal("https://blueshed-podcasts.com/json-feed-extension-docs", blueShedExtension.About);
        }
        public void ParseAndFormat(SampleFeed embeddedDocument)
        {
            // arrange
            var document1 = embeddedDocument.JsonDocument;

            // action
            var tryParseResult = JsonFeedParser.TryParseJsonFeed(document1, out var feed);

            Assert.True(tryParseResult);

            var tryFormatResult = JsonFeedFormatter.TryFormatJsonFeed(feed, out var document2);

            Assert.True(tryFormatResult);

            using (var stringWriter1 = new StringWriter())
                using (var stringWriter2 = new StringWriter())
                    using (var jsonWriter1 = new JsonTextWriter(stringWriter1)
                    {
                        Formatting = Formatting.Indented,
                        StringEscapeHandling = StringEscapeHandling.EscapeHtml,
                        Indentation = 4,
                    })
                        using (var jsonWriter2 = new JsonTextWriter(stringWriter2)
                        {
                            Formatting = Formatting.Indented,
                            StringEscapeHandling = StringEscapeHandling.EscapeHtml,
                            Indentation = 4,
                        })
                        {
                            document1.WriteTo(jsonWriter1);
                            document2.WriteTo(jsonWriter2);
                            jsonWriter1.Flush();
                            jsonWriter2.Flush();

                            // assert
                            var jsonString1 = stringWriter1.ToString();
                            var jsonString2 = stringWriter2.ToString();
                            Assert.Equal(jsonString1, jsonString2);
                        }
        }