PR Feedback

This commit is contained in:
PiotrP 2016-04-25 11:22:32 -07:00
parent 304434433b
commit 91bfc022a2
3 changed files with 9 additions and 11 deletions

View file

@ -11,23 +11,21 @@ namespace Microsoft.DotNet.TestFramework
{ {
public class TestDirectory public class TestDirectory
{ {
private readonly string _path;
internal TestDirectory(string path) internal TestDirectory(string path)
{ {
if (string.IsNullOrEmpty(path)) if (string.IsNullOrEmpty(path))
{ {
throw new ArgumentException("path"); throw new ArgumentException(nameof(path));
} }
_path = path; Path = path;
EnsureExistsAndEmpty(_path); EnsureExistsAndEmpty(Path);
} }
public string Path { get { return _path; } } public string Path { get; private set; }
private void EnsureExistsAndEmpty(string path) private static void EnsureExistsAndEmpty(string path)
{ {
if (Directory.Exists(path)) if (Directory.Exists(path))
{ {
@ -37,4 +35,4 @@ namespace Microsoft.DotNet.TestFramework
Directory.CreateDirectory(path); Directory.CreateDirectory(path);
} }
} }
} }

View file

@ -43,4 +43,4 @@ namespace Microsoft.DotNet.Cli
AssemblyLoadContext.Default.StartProfileOptimization("dotnet"); AssemblyLoadContext.Default.StartProfileOptimization("dotnet");
} }
} }
} }

View file

@ -28,7 +28,7 @@ namespace Microsoft.DotNet.Cli
private void CalculateProfileRootPath() private void CalculateProfileRootPath()
{ {
var profileRoot = GetRuntimeDataRootPath(); var profileRoot = GetRuntimeDataRootPathString();
var version = Product.Version; var version = Product.Version;
@ -37,7 +37,7 @@ namespace Microsoft.DotNet.Cli
_multicoreJitProfilePath = Path.Combine(profileRoot, "sdk", version, rid, "optimizationdata"); _multicoreJitProfilePath = Path.Combine(profileRoot, "sdk", version, rid, "optimizationdata");
} }
private string GetRuntimeDataRootPath() private string GetRuntimeDataRootPathString()
{ {
return RuntimeInformation.IsOSPlatform(OSPlatform.Windows) return RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
? GetWindowsRuntimeDataRoot() ? GetWindowsRuntimeDataRoot()