public void TestExecutionSuccess()
        {
            var command = new Async.SuccessfulTestCommand();


            Assert.AreEqual(0, command.Metrics.GetRollingCount(CommandExecutionEventEnum.Success));
            Assert.AreEqual(0, command.Metrics.GetRollingCount(CommandExecutionEventEnum.Failed));
            Assert.AreEqual(0, command.Metrics.GetRollingCount(CommandExecutionEventEnum.Timeout));

            Assert.AreEqual(true, command.RunAsync().Result);

            Thread.Sleep(command.ConfigSet.MetricsHealthSnapshotIntervalInMilliseconds);

            Assert.AreEqual(1, command.Metrics.GetRollingCount(CommandExecutionEventEnum.Success));
            Assert.AreEqual(0, command.Metrics.GetRollingCount(CommandExecutionEventEnum.Failed));
            Assert.AreEqual(0, command.Metrics.GetRollingCount(CommandExecutionEventEnum.Timeout));
        }
        public void TestExecutionShortCircuted()
        {
            var command = new Async.SuccessfulTestCommand();


            command.ConfigSetForTest.CircuitBreakerEnabled = true;

            command.ConfigSet.CircuitBreakerForceOpen = true;

            Assert.AreEqual(0, command.Metrics.GetRollingCount(CommandExecutionEventEnum.Success));
            Assert.AreEqual(0, command.Metrics.GetRollingCount(CommandExecutionEventEnum.Failed));
            Assert.AreEqual(0, command.Metrics.GetRollingCount(CommandExecutionEventEnum.Timeout));

            Assert.AreEqual(false, command.RunAsync().Result);

            Thread.Sleep(command.ConfigSet.MetricsHealthSnapshotIntervalInMilliseconds);

            Assert.AreEqual(1, command.Metrics.GetRollingCount(CommandExecutionEventEnum.ShortCircuited));
            Assert.AreEqual(0, command.Metrics.GetRollingCount(CommandExecutionEventEnum.Success));
            Assert.AreEqual(0, command.Metrics.GetRollingCount(CommandExecutionEventEnum.Failed));
            Assert.AreEqual(0, command.Metrics.GetRollingCount(CommandExecutionEventEnum.Timeout));
        }