Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@

namespace NuGetUtility.PackageInformationReader
{
public record struct CustomPackageInformation(string Id, INuGetVersion Version, string License, string? Copyright = null, string? Authors = null, string? Title = null, string? ProjectUrl = null, string? Summary = null, string? Description = null);
public record struct CustomPackageInformation(string Id, INuGetVersion Version, string License, Uri? LicenseUrl = null, string? Copyright = null, string? Authors = null, string? Title = null, string? ProjectUrl = null, string? Summary = null, string? Description = null);
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public PackageMetadata(PackageIdentity identity, LicenseType licenseType, Custom

public string? Title => CustomPackageInformation?.Title;

public Uri? LicenseUrl => null;
public Uri? LicenseUrl => CustomPackageInformation?.LicenseUrl;

public string? ProjectUrl => CustomPackageInformation?.ProjectUrl;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ private static void CheckResult(ReferencedPackageWithContext[] result,
Assert.That(packages, Is.EquivalentTo(result.Select(s => new CustomPackageInformation(s.PackageInfo.Identity.Id,
s.PackageInfo.Identity.Version,
s.PackageInfo.LicenseMetadata!.License,
s.PackageInfo.LicenseUrl,
s.PackageInfo.Copyright,
s.PackageInfo.Authors,
s.PackageInfo.Title,
Expand Down Expand Up @@ -125,6 +126,7 @@ public async Task GetPackageInfo_Should_PreferLocalPackageCacheOverRepositories(
mockedInfo.Summary.Returns(info.Summary);
mockedInfo.Description.Returns(info.Description);
mockedInfo.LicenseMetadata.Returns(new LicenseMetadata(LicenseType.Expression, info.License));
mockedInfo.LicenseUrl.Returns(info.LicenseUrl);
_globalPackagesFolderUtility.GetPackage(identity).Returns(mockedInfo);

return identity;
Expand All @@ -147,6 +149,7 @@ private void SetupPackagesForRepositories(IEnumerable<CustomPackageInformation>
IPackageMetadata resultingInfo = Substitute.For<IPackageMetadata>();
resultingInfo.Identity.Returns(new PackageIdentity(package.Id, package.Version));
resultingInfo.LicenseMetadata.Returns(new LicenseMetadata(LicenseType.Expression, package.License));
resultingInfo.LicenseUrl.Returns(package.LicenseUrl);
resultingInfo.Copyright.Returns(package.Copyright);
resultingInfo.Authors.Returns(package.Authors);
resultingInfo.Title.Returns(package.Title);
Expand Down