SolutionPackTests.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. namespace Microsoft.NET.Pack.Tests
  4. {
  5. public class SolutionPackTests : SdkTest
  6. {
  7. public SolutionPackTests(ITestOutputHelper log) : base(log)
  8. {
  9. }
  10. [Fact]
  11. public void ItCanPackASolutionWithOutputPath()
  12. {
  13. var testProject1 = new TestProject()
  14. {
  15. Name = "Project1",
  16. TargetFrameworks = ToolsetInfo.CurrentTargetFramework
  17. };
  18. var testProject2 = new TestProject()
  19. {
  20. Name = "Project2",
  21. TargetFrameworks = ToolsetInfo.CurrentTargetFramework
  22. };
  23. var testAsset = _testAssetsManager.CreateTestProjects(new[] { testProject1, testProject2 });
  24. string packageOutputPath = Path.Combine(testAsset.Path, "output", "packages");
  25. new DotnetCommand(Log, "pack", "--output", packageOutputPath)
  26. .WithWorkingDirectory(testAsset.Path)
  27. .Execute()
  28. .Should()
  29. .Pass();
  30. new FileInfo(Path.Combine(packageOutputPath, testProject1.Name + ".1.0.0.nupkg")).Should().Exist();
  31. new FileInfo(Path.Combine(packageOutputPath, testProject1.Name + ".1.0.0.nupkg")).Should().Exist();
  32. }
  33. }
  34. }