Example #1
0
        public void Breaker_IsClosed_OnCircuitWithoutException()
        {
            var aCircuit = new MyDatabaseCircuit(null);
            var aCommand = new TestExceptionCommand(aCircuit);

            Assert.IsTrue(aCommand.Breaker.IsClosed);
        }
Example #2
0
        public void Breaker_IsClosed_AfterSuccessfulExecuteAction()
        {
            var aCircuit = new MyDatabaseCircuit(null);
            var aCommand = new TestCommand(aCircuit);
            var result   = Task.Run(() => aCommand.ExecuteAction());

            Assert.IsTrue(CommandResult.Succeeded == result.Result);
            Assert.IsTrue(aCommand.Breaker.IsClosed);
        }