public void GetStoreFromFactory() { var store = CircuitBreakerStateStoreFactory.GetCircuitBreakerStateStore(); Assert.IsAssignableFrom <ICircuitBreakerStateStore>(store); Assert.NotNull(store); }
public CircuitSwitchTests() { ICircuitBreakerStateStore circuitBreakerStateStore = CircuitBreakerStateStoreFactory.GetCircuitBreakerStateStore(); IEventLogger eventLogger = new EventLogger(); circuitBreaker = new CircuitBreaker(circuitBreakerStateStore, eventLogger); failingAction = () => { throw new Exception(); }; secondryAction = () => { Console.WriteLine("Nothing to see here"); }; sut = new CircuitSwitch(circuitBreaker, eventLogger); }
public CircuitSwitchIntegrationTests() { ICircuitBreakerStateStore circuitBreakerStateStore = CircuitBreakerStateStoreFactory.GetCircuitBreakerStateStore(); IEventLogger eventLogger = new EventLogger(); circuitBreaker = new CircuitBreaker(circuitBreakerStateStore, eventLogger); sut = new CircuitSwitch(circuitBreaker, eventLogger); var conn = ConnectionMultiplexer.Connect("localhost"); redisService = (IDummyService) new RedisParameterCachingService(conn); dummyServiceMock = new Mock <IDummyService>(); }
public CircuitBreakerTests() { var eventLoggerMock = new Mock <IEventLogger>().Object; sut = (ICircuitBreaker) new CircuitBreaker(CircuitBreakerStateStoreFactory.GetCircuitBreakerStateStore(), eventLoggerMock); }