GivenThatWeWantToPackACrossTargetedLibrary.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 GivenThatWeWantToPackACrossTargetedLibrary : SdkTest
  6. {
  7. public GivenThatWeWantToPackACrossTargetedLibrary(ITestOutputHelper log) : base(log)
  8. {
  9. }
  10. [RequiresMSBuildVersionFact("17.1.0.60101")]
  11. public void It_packs_nondesktop_library_successfully_on_all_platforms()
  12. {
  13. var testAsset = _testAssetsManager
  14. .CopyTestAsset("CrossTargeting")
  15. .WithSource();
  16. var libraryProjectDirectory = Path.Combine(testAsset.TestRoot, "NetStandardAndNetCoreApp");
  17. new PackCommand(Log, libraryProjectDirectory)
  18. .Execute()
  19. .Should()
  20. .Pass();
  21. var outputDirectory = new DirectoryInfo(Path.Combine(libraryProjectDirectory, "bin", "Debug"));
  22. outputDirectory.Should().OnlyHaveFiles(new[] {
  23. "NetStandardAndNetCoreApp.1.0.0.nupkg",
  24. $"{ToolsetInfo.CurrentTargetFramework}/NetStandardAndNetCoreApp.dll",
  25. $"{ToolsetInfo.CurrentTargetFramework}/NetStandardAndNetCoreApp.pdb",
  26. $"{ToolsetInfo.CurrentTargetFramework}/NetStandardAndNetCoreApp.runtimeconfig.json",
  27. $"{ToolsetInfo.CurrentTargetFramework}/NetStandardAndNetCoreApp.deps.json",
  28. $"{ToolsetInfo.CurrentTargetFramework}/Newtonsoft.Json.dll",
  29. $"{ToolsetInfo.CurrentTargetFramework}/NetStandardAndNetCoreApp{EnvironmentInfo.ExecutableExtension}",
  30. "netstandard1.5/NetStandardAndNetCoreApp.dll",
  31. "netstandard1.5/NetStandardAndNetCoreApp.pdb",
  32. "netstandard1.5/NetStandardAndNetCoreApp.deps.json"
  33. });
  34. }
  35. }
  36. }