public async Task ReturnUriFromUrlDefinition() { SwaggerServiceDiscoveryProvider provider = CreateProvider(); Uri uri = await provider.GetSwaggerUriAsync( new SwaggerEndPointConfig() { Url = "http://localhost:5000/swagger" }, new Configuration.ReRouteOptions()); uri.AbsoluteUri.Should().Be("http://localhost:5000/swagger"); }
public async Task ReturnUriFromServiceDiscoveryWhenRouteDoesntExist() { SwaggerServiceDiscoveryProvider provider = CreateProvider(CreateService("Projects", "localhost", 5000)); Uri uri = await provider.GetSwaggerUriAsync( new SwaggerEndPointConfig() { Service = new SwaggerService() { Name = "Projects", Path = "/swagger/v1/json" } }, null); uri.AbsoluteUri.Should().Be("http://localhost:5000/swagger/v1/json"); }
public async Task UseCorrectSchemeByPort(int port, string expectedScheme) { SwaggerServiceDiscoveryProvider provider = CreateProvider(CreateService("Projects", "localhost", port, null)); Uri uri = await provider.GetSwaggerUriAsync( new SwaggerEndPointConfig() { Service = new SwaggerService() { Name = "Projects", Path = "/swagger/v1/json" } }, new Configuration.ReRouteOptions()); uri.Scheme.Should().Be(expectedScheme); }