Example #1
0
        public void Start_CallsRegistry()
        {
            var regMoq       = new Mock <IConsulServiceRegistry>();
            var options      = new ConsulDiscoveryOptions();
            var registration = new ConsulRegistration();
            var reg          = new ConsulServiceRegistrar(regMoq.Object, options, registration);

            reg.Start();
            Assert.Equal(1, reg._running);
            regMoq.Verify(a => a.Register(registration), Times.Once);
        }
Example #2
0
        public void Start_DoesNotStart()
        {
            var regMoq  = new Mock <IConsulServiceRegistry>();
            var options = new ConsulDiscoveryOptions()
            {
                Enabled = false
            };
            var registration = new ConsulRegistration();
            var reg          = new ConsulServiceRegistrar(regMoq.Object, options, registration);

            reg.Start();
            Assert.Equal(0, reg._running);
        }