From 0cbd6838253ecbf439f5abf4287b90be931cc149 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Mon, 7 Dec 2015 16:21:57 -0800 Subject: [PATCH] nix does not have %LOCALAPPDATA%, use SpecialFolder.LocalApplicationData instead --- .../Repositories/FileSystemXmlRepositoryTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.AspNet.DataProtection.Test/Repositories/FileSystemXmlRepositoryTests.cs b/test/Microsoft.AspNet.DataProtection.Test/Repositories/FileSystemXmlRepositoryTests.cs index a0f76c8795..c563dcc17d 100644 --- a/test/Microsoft.AspNet.DataProtection.Test/Repositories/FileSystemXmlRepositoryTests.cs +++ b/test/Microsoft.AspNet.DataProtection.Test/Repositories/FileSystemXmlRepositoryTests.cs @@ -21,7 +21,7 @@ namespace Microsoft.AspNet.DataProtection.Repositories // Assert Assert.Equal(defaultDirInfo.FullName, - new DirectoryInfo(Path.Combine(Environment.ExpandEnvironmentVariables("%LOCALAPPDATA%"), "ASP.NET", "DataProtection-Keys")).FullName); + new DirectoryInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "ASP.NET", "DataProtection-Keys")).FullName); } [Fact] @@ -158,7 +158,7 @@ namespace Microsoft.AspNet.DataProtection.Repositories private class ConditionalRunTestOnlyIfLocalAppDataAvailable : Attribute, ITestCondition { - public bool IsMet => Environment.ExpandEnvironmentVariables("%LOCALAPPDATA%") != null; + public bool IsMet => Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) != null; public string SkipReason { get; } = "%LOCALAPPDATA% couldn't be located."; }