public void ClientEnabledByDefault()
        {
            var services = new ServiceCollection();

            services.AddSingleton <IConfiguration>(new ConfigurationBuilder().Build());

            ConsulDiscoveryClientExtension.ConfigureConsulServices(services);
            var provider      = services.BuildServiceProvider();
            var clientOptions = provider.GetRequiredService <IOptions <ConsulDiscoveryOptions> >();

            Assert.True(clientOptions.Value.Enabled);
        }
        public void ClientDisabledBySpringCloudDiscoveryEnabledFalse()
        {
            var services    = new ServiceCollection();
            var appSettings = new Dictionary <string, string> {
                { "spring:cloud:discovery:enabled", "false" }
            };

            services.AddSingleton <IConfiguration>(new ConfigurationBuilder().AddInMemoryCollection(appSettings).Build());

            ConsulDiscoveryClientExtension.ConfigureConsulServices(services);
            var provider      = services.BuildServiceProvider();
            var clientOptions = provider.GetRequiredService <IOptions <ConsulDiscoveryOptions> >();

            Assert.False(clientOptions.Value.Enabled);
        }