Exemplo n.º 1
0
        public async Task GetSwaggerJsonTest()
        {
            using var srv = new TestServer(TestHostBuilder <Startup, UnigrationWebApiTestStartup>());
            var doc = await SwaggerUnitTests.TestJsonDocAsync(srv);

            Assert.AreEqual($"NurseCRON {nameof(Employee)} {nameof(Api).ToUpper()} Microservice", doc.Info.Title);
        }
Exemplo n.º 2
0
        public async Task TestJsonDocAsync()
        {
            using var srv = new TestServer(TestHostBuilder <Startup, UnitTestStartup>());
            var doc = await SwaggerUnitTests.TestJsonDocAsync(srv);

            Assert.IsNotNull(doc);
        }
Exemplo n.º 3
0
        public async Task GetSwaggerJsonTest()
        {
            using var srv = new TestServer(TestHostBuilder <Startup, UnigrationODataTestStartup>());
            var doc = await SwaggerUnitTests.TestJsonDocAsync(srv);

            Assert.IsTrue(doc.Components.Schemas.ContainsKey(nameof(Schedule)));
            Assert.IsTrue(doc.Components.Schemas.Any(a => a.Key.Contains(nameof(ODataEnvelope <Schedule>))));
            Assert.AreEqual($"{nameof(Schedule)} OData Microservice", doc.Info.Title);
        }
Exemplo n.º 4
0
        public async Task GetSwaggerPageTest()
        {
            using var srv = new TestServer(TestHostBuilder <Startup, UnigrationTestStartup>());
            var htmlPage = await SwaggerUnitTests.TestHtmlPageAsync(srv);

            Assert.IsNotNull(htmlPage);
            var jsonDoc = await SwaggerUnitTests.TestJsonDocAsync(srv);

            Assert.IsNotNull(jsonDoc);
        }
Exemplo n.º 5
0
        public async Task TestJsonDocAsync()
        {
            var myConfiguration = new Dictionary <string, string>
            {
                { SwaggerReverseProxyDocumentFilter.SwaggerReverseProxyBasePath, "/my-api" },
            };

            using var srv = new TestServer(TestHostBuilder <StartUp_AppInsights, UnitTestStartup>()
                                           .ConfigureAppConfiguration((builderContext, configurationBuilder) =>
                                                                      configurationBuilder.AddInMemoryCollection(myConfiguration)
                                                                      ));
            var doc = await SwaggerUnitTests.TestJsonDocAsync(srv);

            _ = await SwaggerUnitTests.TestReverseProxyJsonDocAsync(srv, "/my-api/api");

            Assert.IsNotNull(doc);
        }
Exemplo n.º 6
0
        public async Task GetSwaggerJsonTest()
        {
            var myConfiguration = new Dictionary <string, string>
            {
                { SwaggerReverseProxyDocumentFilter.SwaggerReverseProxyBasePath, "/my-api" },
            };

            using var srv = new TestServer(TestHostBuilder <Startup, UnigrationWebApiTestStartup>()
                                           .ConfigureAppConfiguration((builderContext, configurationBuilder) =>
                                                                      configurationBuilder.AddInMemoryCollection(myConfiguration)
                                                                      ));
            var doc = await SwaggerUnitTests.TestJsonDocAsync(srv);

            _ = await SwaggerUnitTests.TestReverseProxyJsonDocAsync(srv, "/my-api");

            Assert.IsTrue(doc.Components.Schemas.ContainsKey(nameof(Course)));
            Assert.AreEqual($"{nameof(Samples)} WebApi Microservice", doc.Info.Title);
        }