public void IfCalled10Times_ShouldAttemptDifferentLocalIISOperationsRandomly()
        {
            Mock <ChaosLogger> mockLogger = new Mock <ChaosLogger>("");

            LocalIISServerMonkey monkey = new LocalIISServerMonkey(new Settings(), mockLogger.Object);

            monkey.Unleash();
            monkey.Unleash();
            monkey.Unleash();
            monkey.Unleash();
            monkey.Unleash();
            monkey.Unleash();
            monkey.Unleash();
            monkey.Unleash();
            monkey.Unleash();
            monkey.Unleash();
            mockLogger.Verify(logger => logger.Log("Going to recycle random AppPool"), Times.AtLeastOnce());
            mockLogger.Verify(logger => logger.Log("Restarting local IIS"), Times.AtLeastOnce());
            mockLogger.Verify(logger => logger.Log("Going to restart random AppPool"), Times.AtLeastOnce());
        }
        public void IfCalledOnce_OneRandomActionShouldBePerformed()
        {
            Mock <ChaosLogger>   mockLogger = new Mock <ChaosLogger>("");
            LocalIISServerMonkey monkey = new LocalIISServerMonkey(new Settings(), mockLogger.Object);
            int timesAppPoolRecycleOccured = 0, timesIISResetOccured = 0, timesAppPoolRestartOccured = 0;

            mockLogger.Setup(logger => logger.Log("Going to recycle random AppPool")).Callback(
                () => timesAppPoolRecycleOccured++);

            mockLogger.Setup(logger => logger.Log("Going to restart random AppPool")).Callback(
                () => timesAppPoolRestartOccured++);

            mockLogger.Setup(logger => logger.Log("Restarting local IIS")).Callback(
                () => timesIISResetOccured++
                );

            monkey.Unleash();

            Assert.IsTrue(timesIISResetOccured + timesAppPoolRecycleOccured + timesAppPoolRestartOccured == 1,
                          "Either LocalIISServerMonkey didn't perform operation or performed multiple times");
        }