Esempio n. 1
0
        public void should_not_get()
        {
            var config   = new ServiceProviderConfigurationBuilder().Build();
            var sp       = new ServiceCollection().BuildServiceProvider();
            var provider = EurekaProviderFactory.Get(sp, config, null);

            provider.ShouldBeNull();
        }
        public void should_get()
        {
            var config   = new ServiceProviderConfigurationBuilder().WithType("eureka").Build();
            var client   = new Mock <IDiscoveryClient>();
            var services = new ServiceCollection();

            services.AddSingleton <IDiscoveryClient>(client.Object);
            var sp       = services.BuildServiceProvider();
            var provider = EurekaProviderFactory.Get(sp, config, null);

            provider.ShouldBeOfType <Eureka>();
        }