Addressing code review comments.

This commit is contained in:
Livar Cunha 2016-11-23 10:19:00 -08:00
parent dc87680337
commit d5f7efbe86
3 changed files with 26 additions and 27 deletions

View file

@ -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;
}
}

View file

@ -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]

View file

@ -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);