Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Update unit test, now that bundler is a library
Browse files Browse the repository at this point in the history
  • Loading branch information
swaroop-sridhar committed Apr 12, 2019
1 parent ed673ce commit 512fb85
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/test/HostActivationTests/BundledAppWithSubDirs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,20 @@ private void Bundle_And_Run_App_With_Subdirs_Succeeds()
// once associated changes in SDK repo are checked in.
string singleFileDir = Path.Combine(fixture.TestProject.ProjectDirectory, "oneExe");
Directory.CreateDirectory(singleFileDir);
string bundleDll = Path.Combine(sharedTestState.RepoDirectories.Artifacts,
"Microsoft.NET.Build.Bundle",
"netcoreapp2.0",
"Microsoft.NET.Build.Bundle.dll");
string[] bundleArgs = { "--source", fixture.TestProject.OutputDirectory,
"--apphost", hostName,
"--output", singleFileDir };
var bundler = new Microsoft.NET.HostModel.Bundle.Bundler(hostName, singleFileDir);
string singleFile = bundler.GenerateBundle(fixture.TestProject.OutputDirectory);

fixture.SdkDotnet.Exec(bundleDll, bundleArgs)
// Run the bundled app (extract files)
Command.Create(singleFile)
.CaptureStdErr()
.CaptureStdOut()
.Execute()
.Should()
.Pass();
.Pass()
.And
.HaveStdOutContaining("Wow! We now say hello to the big world and you.");

// Run the bundled app
string singleFile = Path.Combine(singleFileDir, hostName);
// Run the bundled app again (reuse extracted files)
Command.Create(singleFile)
.CaptureStdErr()
.CaptureStdOut()
Expand Down
2 changes: 2 additions & 0 deletions src/test/HostActivationTests/HostActivationTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

<ItemGroup>
<ProjectReference Include="..\TestUtils\TestUtils.csproj" />
<!-- This project reference should be removed once SDK changes to bundle via publish are available -->
<ProjectReference Include="..\..\managed\Microsoft.NET.HostModel\Microsoft.NET.HostModel.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 512fb85

Please sign in to comment.