public void IsCI_Tests(bool isCiEnv, bool?verboseLogging, bool expected) { try { if (isCiEnv) { Environment.SetEnvironmentVariable(LoggingFilterHelper.Ci_Build_Number, "90l99"); } var testConfiguration = TestUtils.CreateSetupWithConfiguration(null); LoggingFilterHelper loggingFilterHelper = new LoggingFilterHelper(testConfiguration, verboseLogging); Assert.Equal(expected, loggingFilterHelper.IsCiEnvironment(verboseLogging.HasValue)); } finally { Environment.SetEnvironmentVariable(LoggingFilterHelper.Ci_Build_Number, ""); } }
public void IsCI_Tests(bool isCiEnv, bool?verboseLogging, bool expected) { try { if (isCiEnv) { Environment.SetEnvironmentVariable(LoggingFilterHelper.Ci_Build_Number, "90l99"); } string defaultJson = "{\"version\": \"2.0\"}"; FileSystemHelpers.WriteAllTextToFile(_hostJsonFilePath, defaultJson); var configuration = Utilities.BuildHostJsonConfigutation(_hostOptions); LoggingFilterHelper loggingFilterHelper = new LoggingFilterHelper(configuration, verboseLogging); Assert.Equal(expected, loggingFilterHelper.IsCiEnvironment(verboseLogging.HasValue)); Environment.SetEnvironmentVariable(LoggingFilterHelper.Ci_Build_Number, ""); } finally { DeleteIfExists(_workerDir); } }