示例#1
0
        public void DocumentFilterIsAppliedToAsyncApiDocument()
        {
            // Arrange
            var options = new AsyncApiOptions();
            var documentGenerator = new DocumentGenerator();

            // Act
            options.AddDocumentFilter<ExampleDocumentFilter>();
            var document = documentGenerator.GenerateDocument(new[] { GetType().GetTypeInfo() }, options, options.AsyncApi, ActivatorServiceProvider.Instance);

            // Assert
            document.ShouldNotBeNull();
            document.Channels.Count.ShouldBe(1);
            document.Channels.ShouldContainKey("foo");
        }