From 5595774a57443a85b0f0980e3adda6a45592c5d2 Mon Sep 17 00:00:00 2001 From: Daniel Cazzulino Date: Thu, 8 Oct 2020 00:33:15 -0300 Subject: [PATCH] Ensure we have at least a dependency when testing package license --- src/NuGetizer.Tests/CreatePackageTests.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/NuGetizer.Tests/CreatePackageTests.cs b/src/NuGetizer.Tests/CreatePackageTests.cs index 3d21b3b8..49df4ee6 100644 --- a/src/NuGetizer.Tests/CreatePackageTests.cs +++ b/src/NuGetizer.Tests/CreatePackageTests.cs @@ -154,6 +154,18 @@ public void when_creating_package_has_development_dependency_metadata_then_manif [Fact] public void when_creating_package_has_license_expression_then_manifest_has_license() { + task.Contents = new[] + { + // Need at least one dependency or content file for the generation to succeed. + new TaskItem("Newtonsoft.Json", new Metadata + { + { MetadataName.PackageId, task.Manifest.GetMetadata("Id") }, + { MetadataName.PackFolder, PackFolderKind.Dependency }, + { MetadataName.Version, "8.0.0" }, + { MetadataName.TargetFramework, "net45" } + }), + }; + task.Manifest.SetMetadata("LicenseUrl", ""); task.Manifest.SetMetadata("LicenseExpression", "MIT");