Skip to content

Commit 27fc65c

Browse files
committed
Fixing tests for output path change.
1 parent b1edbbe commit 27fc65c

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

test/Microsoft.NET.Build.Tests/GivenThatWeWantToReferenceAnAssembly.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class GivenThatWeWantToReferenceAnAssembly : SdkTest
2323
[InlineData("netcoreapp2.0", "netstandard1.5")]
2424
[InlineData("netcoreapp2.0", "netcoreapp1.0")]
2525
public void ItRunsAppsDirectlyReferencingAssemblies(
26-
string referencerTarget,
26+
string referencerTarget,
2727
string dependencyTarget)
2828
{
2929
string identifier = referencerTarget.ToString() + "_" + dependencyTarget.ToString();
@@ -77,7 +77,7 @@ public static void Main()
7777
}
7878
";
7979

80-
var referencerAsset = _testAssetsManager.CreateTestProject(referencerProject, identifier: identifier);
80+
var referencerAsset = _testAssetsManager.CreateTestProject(referencerProject, identifier: identifier);
8181
string applicationPath = RestoreAndBuild(referencerAsset, referencerProject);
8282

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

100-
var outputDirectory = buildCommand.GetOutputDirectory(testProject.TargetFrameworks);
100+
var outputDirectory = buildCommand.GetOutputDirectory(
101+
testProject.TargetFrameworks,
102+
runtimeIdentifier: testProject.RuntimeIdentifier);
101103
return Path.Combine(outputDirectory.FullName, testProject.Name + ".dll");
102104
}
103105
}

test/Microsoft.NET.TestFramework/Commands/TestCommand.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ private string FindProjectFile(string relativePathToProject)
4646

4747
public virtual DirectoryInfo GetOutputDirectory(string targetFramework, string configuration = "Debug", string runtimeIdentifier = "")
4848
{
49+
targetFramework = targetFramework ?? string.Empty;
50+
configuration = configuration ?? string.Empty;
51+
runtimeIdentifier = runtimeIdentifier ?? string.Empty;
52+
4953
string output = Path.Combine(ProjectRootPath, "bin", configuration, targetFramework, runtimeIdentifier);
5054
return new DirectoryInfo(output);
5155
}

0 commit comments

Comments
 (0)