public void WeCanUseConfigureToSetupTheDefaultClientWithoutAAclToken() { var address = new Uri("http://localhost:8501"); var options = new ConsulClusteringOptions(); //we can configure the default consult client options.ConfigureConsulClient(address); var client = (ConsulClient)options.CreateClient(); Assert.Equal(address, client.Config.Address); Assert.Null(client.Config.Token); }
public void WeCanInjectAConsulClient() { var fakeConsul = new FakeConsul(); var options = new ConsulClusteringOptions(); Func <IConsulClient> callback = () => fakeConsul; //we can inject the consul options.ConfigureConsulClient(callback); var actual = options.CreateClient(); Assert.Equal(fakeConsul, actual); }
public Task InitializeGatewayListProvider() { consulClient = options.CreateClient(); return(Task.CompletedTask); }