public void AddSwaggerDocumentationTest() { // Arrange IServiceCollection services = new ServiceCollection(); string error = null; // Act try { SwaggerServiceExtensions.AddSwaggerDocumentation(services); } catch (Exception ex) { error = ex.ToString(); } // Assert Assert.IsNull(error); }
public void UseSwaggerDocumentationTest() { // Arrange IServiceCollection services = new ServiceCollection(); SwaggerServiceExtensions.AddSwaggerDocumentation(services); ServiceProvider serviceProvider = services.BuildServiceProvider(); IApplicationBuilder app = new Microsoft.AspNetCore.Builder.ApplicationBuilder(serviceProvider); string error = null; // Act try { SwaggerServiceExtensions.UseSwaggerDocumentation(app); } catch (Exception ex) { error = ex.ToString(); } // Assert Assert.IsNull(error); }