mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-19 11:58:15 +08:00
started implementing the consul service provider
This commit is contained in:
@ -21,7 +21,7 @@ namespace Ocelot.UnitTests.ServiceDiscovery
|
||||
|
||||
var services = new List<Service>
|
||||
{
|
||||
new Service("product", hostAndPort)
|
||||
new Service("product", hostAndPort, string.Empty, string.Empty, new string[0])
|
||||
};
|
||||
|
||||
this.Given(x => x.GivenServices(services))
|
||||
@ -38,7 +38,7 @@ namespace Ocelot.UnitTests.ServiceDiscovery
|
||||
private void WhenIGetTheService()
|
||||
{
|
||||
_serviceProvider = new ConfigurationServiceProvider(_expected);
|
||||
_result = _serviceProvider.Get();
|
||||
_result = _serviceProvider.Get().Result;
|
||||
}
|
||||
|
||||
private void ThenTheFollowingIsReturned(List<Service> services)
|
||||
|
@ -1,3 +1,4 @@
|
||||
using Ocelot.Configuration;
|
||||
using Ocelot.ServiceDiscovery;
|
||||
using Shouldly;
|
||||
using TestStack.BDDfy;
|
||||
@ -19,7 +20,7 @@ namespace Ocelot.UnitTests.ServiceDiscovery
|
||||
[Fact]
|
||||
public void should_return_no_service_provider()
|
||||
{
|
||||
var serviceConfig = new ServiceProviderConfiguraion("product", "127.0.0.1", 80, false, "Does not matter");
|
||||
var serviceConfig = new ServiceProviderConfiguraion("product", "127.0.0.1", 80, false, "Does not matter", string.Empty, 0);
|
||||
|
||||
this.Given(x => x.GivenTheReRoute(serviceConfig))
|
||||
.When(x => x.WhenIGetTheServiceProvider())
|
||||
@ -30,7 +31,7 @@ namespace Ocelot.UnitTests.ServiceDiscovery
|
||||
[Fact]
|
||||
public void should_return_consul_service_provider()
|
||||
{
|
||||
var serviceConfig = new ServiceProviderConfiguraion("product", string.Empty, 0, true, "Consul");
|
||||
var serviceConfig = new ServiceProviderConfiguraion("product", string.Empty, 0, true, "Consul", string.Empty, 0);
|
||||
|
||||
this.Given(x => x.GivenTheReRoute(serviceConfig))
|
||||
.When(x => x.WhenIGetTheServiceProvider())
|
||||
|
@ -50,13 +50,13 @@ namespace Ocelot.UnitTests.ServiceDiscovery
|
||||
|
||||
private void GivenAServiceIsRegistered(string name, string address, int port)
|
||||
{
|
||||
_service = new Service(name, new HostAndPort(address, port));
|
||||
_service = new Service(name, new HostAndPort(address, port), string.Empty, string.Empty, new string[0]);
|
||||
_serviceRepository.Set(_service);
|
||||
}
|
||||
|
||||
private void GivenAServiceToRegister(string name, string address, int port)
|
||||
{
|
||||
_service = new Service(name, new HostAndPort(address, port));
|
||||
_service = new Service(name, new HostAndPort(address, port), string.Empty, string.Empty, new string[0]);
|
||||
}
|
||||
|
||||
private void WhenIRegisterTheService()
|
||||
|
Reference in New Issue
Block a user