Пример #1
0
        public void EnvironmentIsUnknownIfBuildVariablesDontHaveValues()
        {
            envVariableGetter = Substitute.For <IEnvironmentVariableReader>();

            foreach (var knownEnvironmentVariable in LogExtensions.KnownEnvironmentVariables)
            {
                foreach (var variable in knownEnvironmentVariable.Value)
                {
                    envVariableGetter.GetVariableValue(variable).Returns("");
                }
            }

            LogExtensions.environmentVariableReader = envVariableGetter;

            LogExtensions.EnableServiceMessages(Log);

            Assert.IsFalse(LogExtensions.IsKnownEnvironment());
        }
Пример #2
0
 static bool EnvironmentVariableHasValue(string variableName)
 {
     return(!string.IsNullOrEmpty(environmentVariableReader.GetVariableValue(variableName)));
 }