Example #1
0
 private void AssertLiGetTestEntry(V2FeedPackageInfo dummyEntry)
 {
     Assert.Equal("liget-test1", dummyEntry.Id);
     Assert.Equal(NuGetVersion.Parse("1.0.0"), dummyEntry.Version);
     Assert.Equal("liget-test1", dummyEntry.Authors.Single());
     Assert.Equal("::netstandard2.0", dummyEntry.Dependencies);
 }
Example #2
0
        public PackageSearchMetadataV2Feed(V2FeedPackageInfo package)
        {
            Authors                  = string.Join(", ", package.Authors);
            DependencySets           = package.DependencySets;
            Description              = package.Description;
            IconUrl                  = GetUriSafe(package.IconUrl);
            LicenseUrl               = GetUriSafe(package.LicenseUrl);
            Owners                   = string.Join(", ", package.Owners);
            PackageId                = package.Id;
            ProjectUrl               = GetUriSafe(package.ProjectUrl);
            Published                = package.Published;
            ReportAbuseUrl           = GetUriSafe(package.ReportAbuseUrl);
            RequireLicenseAcceptance = package.RequireLicenseAcceptance;
            Summary                  = package.Summary;
            Tags    = package.Tags;
            Title   = package.Title;
            Version = package.Version;

            long count;

            if (long.TryParse(package.DownloadCount, out count))
            {
                DownloadCount = count;
            }
        }
Example #3
0
 private void AssertDummyEntry(V2FeedPackageInfo dummyEntry)
 {
     Assert.Equal(dummy1_0_0.Title, dummyEntry.Title);
     Assert.Equal(dummy1_0_0.Id, dummyEntry.Id);
     Assert.Equal(dummy1_0_0.Version, dummyEntry.Version);
     Assert.Equal(dummy1_0_0.Authors, dummyEntry.Authors);
     Assert.Equal(dummy1_0_0.LicenseUrl.AbsoluteUri, dummyEntry.LicenseUrl);
     Assert.Null(dummyEntry.MinClientVersion);
     Assert.Equal(dummy1_0_0.Published, dummyEntry.Published);
     Assert.Equal("Consul:[0.7.2.6, ):.NETStandard2.0", dummyEntry.Dependencies);
 }
Example #4
0
 private void AssertDummyEntry(V2FeedPackageInfo dummyEntry)
 {
     Assert.Equal(dummy1_0_0.PackageInfo.Title, dummyEntry.Title);
     Assert.Equal(dummy1_0_0.PackageInfo.Id, dummyEntry.Id);
     Assert.Equal(dummy1_0_0.PackageInfo.Version, dummyEntry.Version.OriginalVersion);
     Assert.Equal(dummy1_0_0.PackageInfo.Authors, Assert.Single(dummyEntry.Authors));
     Assert.Equal(dummy1_0_0.PackageInfo.LicenseUrl, dummyEntry.LicenseUrl);
     Assert.Equal(dummy1_0_0.PackageInfo.PackageHash, dummyEntry.PackageHash);
     Assert.Equal(dummy1_0_0.PackageInfo.PackageHashAlgorithm, dummyEntry.PackageHashAlgorithm);
     Assert.Null(dummyEntry.MinClientVersion);
     Assert.Equal(dummy1_0_0.PackageInfo.Published, dummyEntry.Published);
 }
Example #5
0
 /// <summary>
 /// Converts a <see cref="V2FeedPackageInfo"/> into a format that can be directly compared to a <see cref="PackageRegistrationIndexMetadata"/>.
 /// </summary>
 public PackageRegistrationIndexMetadata(V2FeedPackageInfo package)
     : base(package)
 {
     Authors                  = string.Join(", ", package.Authors);
     Description              = package.Description;
     IconUrl                  = package.IconUrl;
     Id                       = package.Id;
     MinClientVersion         = package.MinClientVersion;
     ProjectUrl               = package.ProjectUrl;
     RequireLicenseAcceptance = package.RequireLicenseAcceptance;
     Summary                  = package.Summary;
     Tags                     = package.Tags.Split(' ').Where(s => !string.IsNullOrEmpty(s)).ToArray();
     Title                    = package.Title;
     Version                  = package.Version;
 }
 /// <summary>
 /// Converts a <see cref="V2FeedPackageInfo"/> into a format that can be directly compared to a <see cref="PackageRegistrationLeafMetadata"/>.
 /// </summary>
 public PackageRegistrationLeafMetadata(V2FeedPackageInfo package)
 {
     Listed         = package.IsListed;
     PackageContent = package.DownloadUrl;
     Published      = package.Published;
 }