Example #1
0
        public void CheckAlwaysOn_OnlyLogsOncePerLogFile()
        {
            System.Environment.SetEnvironmentVariable(ContinuousJobRunner.WebsiteSCMAlwaysOnEnabledKey, "0");

            _runner.CheckAlwaysOn();
            _runner.CheckAlwaysOn();
            _runner.CheckAlwaysOn();

            VerifyAlwaysOnWarningWritten();

            // when the log file is rolled, we expect the new log file to
            // contain the warning
            FileSystemHelpers.DeleteFileSafe(_logFilePath);
            _runner.OnLogFileRolled();
            _runner.CheckAlwaysOn();
            _runner.CheckAlwaysOn();

            VerifyAlwaysOnWarningWritten();

            System.Environment.SetEnvironmentVariable(ContinuousJobRunner.WebsiteSCMAlwaysOnEnabledKey, null);
        }