Addressing code review comments.
This commit is contained in:
parent
dc87680337
commit
d5f7efbe86
3 changed files with 26 additions and 27 deletions
|
@ -15,7 +15,8 @@ namespace Microsoft.DotNet.Cli.Utils
|
|||
{
|
||||
get
|
||||
{
|
||||
return new DirectoryInfo(Path.GetDirectoryName(GetDataFromAppDomain("FX_DEPS_FILE"))).Name;
|
||||
var depsFile = new FileInfo(Path.GetDirectoryName(GetDataFromAppDomain("FX_DEPS_FILE")));
|
||||
return depsFile.Directory.Name;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ namespace Microsoft.DotNet.Tests.EndToEnd
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void ItCanRunToolsThatPrefersTheCliRuntime()
|
||||
public void ItCanRunToolsThatPrefersTheCliRuntimeEvenWhenTheToolItselfDeclaresADifferentRuntime()
|
||||
{
|
||||
var testInstance = TestAssets.Get("MSBuildTestApp")
|
||||
.CreateInstance()
|
||||
|
@ -82,10 +82,8 @@ namespace Microsoft.DotNet.Tests.EndToEnd
|
|||
new DotnetCommand()
|
||||
.WithWorkingDirectory(testInstance.Root)
|
||||
.ExecuteWithCapturedOutput("prefercliruntime")
|
||||
.Should()
|
||||
.Pass()
|
||||
.And
|
||||
.HaveStdOutContaining("Hello I prefer the cli runtime World!");;
|
||||
.Should().Pass()
|
||||
.And.HaveStdOutContaining("Hello I prefer the cli runtime World!");;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
@ -80,16 +80,16 @@ namespace Microsoft.DotNet.Tests
|
|||
{
|
||||
var projectToolsCommandResolver = SetupProjectToolsCommandResolver();
|
||||
|
||||
var testInstance = TestAssetsManager
|
||||
.CreateTestInstance(TestProjectName)
|
||||
.WithNuGetMSBuildFiles()
|
||||
.WithLockFiles();
|
||||
var testInstance = TestAssets.Get(TestProjectName)
|
||||
.CreateInstance()
|
||||
.WithSourceFiles()
|
||||
.WithRestoreFiles();
|
||||
|
||||
var commandResolverArguments = new CommandResolverArguments()
|
||||
{
|
||||
CommandName = "nonexistent-command",
|
||||
CommandArguments = null,
|
||||
ProjectDirectory = testInstance.Path
|
||||
ProjectDirectory = testInstance.Root.FullName
|
||||
};
|
||||
|
||||
var result = projectToolsCommandResolver.Resolve(commandResolverArguments);
|
||||
|
@ -102,16 +102,16 @@ namespace Microsoft.DotNet.Tests
|
|||
{
|
||||
var projectToolsCommandResolver = SetupProjectToolsCommandResolver();
|
||||
|
||||
var testInstance = TestAssetsManager
|
||||
.CreateTestInstance(TestProjectName)
|
||||
.WithNuGetMSBuildFiles()
|
||||
.WithLockFiles();
|
||||
var testInstance = TestAssets.Get(TestProjectName)
|
||||
.CreateInstance()
|
||||
.WithSourceFiles()
|
||||
.WithRestoreFiles();
|
||||
|
||||
var commandResolverArguments = new CommandResolverArguments()
|
||||
{
|
||||
CommandName = "dotnet-portable",
|
||||
CommandArguments = null,
|
||||
ProjectDirectory = testInstance.Path
|
||||
ProjectDirectory = testInstance.Root.FullName
|
||||
};
|
||||
|
||||
var result = projectToolsCommandResolver.Resolve(commandResolverArguments);
|
||||
|
@ -266,23 +266,23 @@ namespace Microsoft.DotNet.Tests
|
|||
{
|
||||
var projectToolsCommandResolver = SetupProjectToolsCommandResolver();
|
||||
|
||||
var testInstance = TestAssetsManager
|
||||
.CreateTestInstance("MSBuildTestApp")
|
||||
.WithNuGetMSBuildFiles()
|
||||
.WithLockFiles();
|
||||
var testInstance = TestAssets.Get("MSBuildTestApp")
|
||||
.CreateInstance()
|
||||
.WithSourceFiles()
|
||||
.WithRestoreFiles();
|
||||
|
||||
var commandResolverArguments = new CommandResolverArguments()
|
||||
{
|
||||
CommandName = "dotnet-prefercliruntime",
|
||||
CommandArguments = null,
|
||||
ProjectDirectory = testInstance.Path
|
||||
ProjectDirectory = testInstance.Root.FullName
|
||||
};
|
||||
|
||||
var result = projectToolsCommandResolver.Resolve(commandResolverArguments);
|
||||
|
||||
result.Should().NotBeNull();
|
||||
|
||||
result.Args.Should().Contain("-fx-version 1.0.1");
|
||||
result.Args.Should().Contain("--fx-version 1.0.1");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
@ -290,16 +290,16 @@ namespace Microsoft.DotNet.Tests
|
|||
{
|
||||
var projectToolsCommandResolver = SetupProjectToolsCommandResolver();
|
||||
|
||||
var testInstance = TestAssetsManager
|
||||
.CreateTestInstance(TestProjectName)
|
||||
.WithNuGetMSBuildFiles()
|
||||
.WithLockFiles();
|
||||
var testInstance = TestAssets.Get(TestProjectName)
|
||||
.CreateInstance()
|
||||
.WithSourceFiles()
|
||||
.WithRestoreFiles();
|
||||
|
||||
var commandResolverArguments = new CommandResolverArguments()
|
||||
{
|
||||
CommandName = "dotnet-portable",
|
||||
CommandArguments = null,
|
||||
ProjectDirectory = testInstance.Path
|
||||
ProjectDirectory = testInstance.Root.FullName
|
||||
};
|
||||
|
||||
var result = projectToolsCommandResolver.Resolve(commandResolverArguments);
|
||||
|
|
Loading…
Reference in a new issue