Feature Complete
- Add remaining test scenarios - Refactor implementation - Add gitignore entry for optimization profiles
This commit is contained in:
parent
94e620088e
commit
304434433b
5 changed files with 165 additions and 30 deletions
31
test/dotnet.Tests/TestCommandExtensions.cs
Normal file
31
test/dotnet.Tests/TestCommandExtensions.cs
Normal file
|
@ -0,0 +1,31 @@
|
|||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Microsoft.DotNet.Cli.Utils;
|
||||
using Microsoft.DotNet.Tools.Test.Utilities;
|
||||
using Microsoft.Extensions.PlatformAbstractions;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
using FluentAssertions;
|
||||
|
||||
namespace Microsoft.DotNet.Tests
|
||||
{
|
||||
public static class TestCommandExtensions
|
||||
{
|
||||
public static TestCommand WithUserProfileRoot(this TestCommand testCommand, string path)
|
||||
{
|
||||
var userProfileEnvironmentVariableName = GetUserProfileEnvironmentVariableName();
|
||||
return testCommand.WithEnvironmentVariable(userProfileEnvironmentVariableName, path);
|
||||
}
|
||||
|
||||
private static string GetUserProfileEnvironmentVariableName()
|
||||
{
|
||||
return RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
|
||||
? "LocalAppData"
|
||||
: "HOME";
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue