Skip to content

Commit

Permalink
Fixing tests for output path change.
Browse files Browse the repository at this point in the history
  • Loading branch information
eerhardt committed Feb 27, 2017
1 parent b1edbbe commit 27fc65c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class GivenThatWeWantToReferenceAnAssembly : SdkTest
[InlineData("netcoreapp2.0", "netstandard1.5")]
[InlineData("netcoreapp2.0", "netcoreapp1.0")]
public void ItRunsAppsDirectlyReferencingAssemblies(
string referencerTarget,
string referencerTarget,
string dependencyTarget)
{
string identifier = referencerTarget.ToString() + "_" + dependencyTarget.ToString();
Expand Down Expand Up @@ -77,7 +77,7 @@ public static void Main()
}
";

var referencerAsset = _testAssetsManager.CreateTestProject(referencerProject, identifier: identifier);
var referencerAsset = _testAssetsManager.CreateTestProject(referencerProject, identifier: identifier);
string applicationPath = RestoreAndBuild(referencerAsset, referencerProject);

Command.Create(RepoInfo.DotNetHostPath, new[] { applicationPath })
Expand All @@ -97,7 +97,9 @@ private static string RestoreAndBuild(TestAsset testAsset, TestProject testProje
.Should()
.Pass();

var outputDirectory = buildCommand.GetOutputDirectory(testProject.TargetFrameworks);
var outputDirectory = buildCommand.GetOutputDirectory(
testProject.TargetFrameworks,
runtimeIdentifier: testProject.RuntimeIdentifier);
return Path.Combine(outputDirectory.FullName, testProject.Name + ".dll");
}
}
Expand Down
4 changes: 4 additions & 0 deletions test/Microsoft.NET.TestFramework/Commands/TestCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ private string FindProjectFile(string relativePathToProject)

public virtual DirectoryInfo GetOutputDirectory(string targetFramework, string configuration = "Debug", string runtimeIdentifier = "")
{
targetFramework = targetFramework ?? string.Empty;
configuration = configuration ?? string.Empty;
runtimeIdentifier = runtimeIdentifier ?? string.Empty;

string output = Path.Combine(ProjectRootPath, "bin", configuration, targetFramework, runtimeIdentifier);
return new DirectoryInfo(output);
}
Expand Down

0 comments on commit 27fc65c

Please sign in to comment.