示例#1
0
        public void ExpandEnvironmentVariables_Long()
        {
            string longValue = new string('a', 100);

            try
            {
                Environment.SetEnvironmentVariable("ExpandEnvironmentVariables_Long", longValue);
                SystemInformationMethods.ExpandEnvironmentVariables(@"%ExpandEnvironmentVariables_Long%").
                Should().Be(longValue);
            }
            finally
            {
                Environment.SetEnvironmentVariable("ExpandEnvironmentVariables_Long", null);
            }
        }
示例#2
0
 public void ExpandEnvironmentVariables_Existing()
 {
     SystemInformationMethods.ExpandEnvironmentVariables(@"%COMPUTERNAME%").
     Should().Be(Environment.GetEnvironmentVariable("COMPUTERNAME"));
 }