Fix PublishTestAppWithContentPackage test to work on all platforms.

This commit is contained in:
Eric Erhardt 2016-04-13 18:38:15 -05:00
parent f6f1a52ec4
commit deef7f867f

View file

@ -16,13 +16,18 @@ namespace Microsoft.DotNet.Tools.Publish.Tests
var testInstance = TestAssetsManager.CreateTestInstance("TestAppWithContentPackage") var testInstance = TestAssetsManager.CreateTestInstance("TestAppWithContentPackage")
.WithLockFiles(); .WithLockFiles();
var publishDir = Publish(testInstance); var publishCommand = new PublishCommand(testInstance.TestRoot);
var publishResult = publishCommand.Execute();
publishResult.Should().Pass();
var publishDir = publishCommand.GetOutputDirectory(portable: false);
publishDir.Should().HaveFiles(new[] publishDir.Should().HaveFiles(new[]
{ {
"TestAppWithContentPackage.exe", $"AppWithContentPackage{publishCommand.GetExecutableExtension()}",
"TestAppWithContentPackage.dll", "AppWithContentPackage.dll",
"TestAppWithContentPackage.deps.json" "AppWithContentPackage.deps.json"
}); });
// these files come from the contentFiles of the SharedContentA dependency // these files come from the contentFiles of the SharedContentA dependency
@ -37,15 +42,5 @@ namespace Microsoft.DotNet.Tools.Publish.Tests
.Should() .Should()
.HaveFile("config.xml"); .HaveFile("config.xml");
} }
private DirectoryInfo Publish(TestInstance testInstance)
{
var publishCommand = new PublishCommand(testInstance.TestRoot);
var publishResult = publishCommand.Execute();
publishResult.Should().Pass();
return publishCommand.GetOutputDirectory(portable: false);
}
} }
} }