public ServiceDiscoveryProviderFactoryTests()
 {
     _loggerFactory = new Mock <IOcelotLoggerFactory>();
     _logger        = new Mock <IOcelotLogger>();
     _collection    = new ServiceCollection();
     _provider      = _collection.BuildServiceProvider();
     _factory       = new ServiceDiscoveryProviderFactory(_loggerFactory.Object, _provider);
 }
        private void GivenAFakeDelegate()
        {
            ServiceDiscoveryFinderDelegate fake = (provider, config, name) => new Fake();

            _collection.AddSingleton(fake);
            _provider = _collection.BuildServiceProvider();
            _factory  = new ServiceDiscoveryProviderFactory(_loggerFactory.Object, _provider);
        }
Пример #3
0
        public ServiceProviderFactoryTests()
        {
            _loggerFactory = new Mock <IOcelotLoggerFactory>();
            _logger        = new Mock <IOcelotLogger>();
            _loggerFactory.Setup(x => x.CreateLogger <PollingConsulServiceDiscoveryProvider>()).Returns(_logger.Object);
            _discoveryClient = new Mock <IDiscoveryClient>();
            var consulClient = new Mock <IConsulClientFactory>();

            _factory = new ServiceDiscoveryProviderFactory(_loggerFactory.Object, consulClient.Object, _discoveryClient.Object);
        }
 public ServiceProviderFactoryTests()
 {
     _factory = new ServiceDiscoveryProviderFactory();
 }
Пример #5
0
 public ServiceProviderFactoryTests()
 {
     _loggerFactory   = new Mock <IOcelotLoggerFactory>();
     _discoveryClient = new Mock <IDiscoveryClient>();
     _factory         = new ServiceDiscoveryProviderFactory(_loggerFactory.Object, new ConsulClientFactory(), _discoveryClient.Object);
 }
Пример #6
0
 public ServiceProviderFactoryTests()
 {
     _loggerFactory = new Mock <IOcelotLoggerFactory>();
     _factory       = new ServiceDiscoveryProviderFactory(_loggerFactory.Object);
 }