Example #1
0
        public void BadgeUtility_GetChanges_EmptySets()
        {
            var before = new HashSet <PackageIdentity>();
            var after  = new HashSet <PackageIdentity>();


            BadgeUtility.GetChanges(before, after, preRel: false).Should().BeEmpty();
        }
Example #2
0
        public void BadgeUtility_GetChanges_NewPackage()
        {
            var before = new HashSet <PackageIdentity>();
            var after  = new HashSet <PackageIdentity>()
            {
                new PackageIdentity("a", NuGetVersion.Parse("1.0.0"))
            };

            BadgeUtility.GetChanges(before, after, preRel: false).Count.Should().Be(1);
        }
Example #3
0
        public void BadgeUtility_GetChanges_NoPackageChanges()
        {
            var before = new HashSet <PackageIdentity>()
            {
                new PackageIdentity("A", NuGetVersion.Parse("1.0.0-a"))
            };
            var after = new HashSet <PackageIdentity>()
            {
                new PackageIdentity("a", NuGetVersion.Parse("1.0.0-a"))
            };

            BadgeUtility.GetChanges(before, after, preRel: true).Should().BeEmpty();
        }
Example #4
0
        public void BadgeUtility_GetChanges_MultipleAddedInSameId_NoStable()
        {
            var before = new HashSet <PackageIdentity>()
            {
                new PackageIdentity("a", NuGetVersion.Parse("1.0.0-a"))
            };
            var after = new HashSet <PackageIdentity>()
            {
                new PackageIdentity("a", NuGetVersion.Parse("2.0.0-a")),
                new PackageIdentity("a", NuGetVersion.Parse("3.0.0-a"))
            };

            BadgeUtility.GetChanges(before, after, preRel: false).Count.Should().Be(1);
            BadgeUtility.GetChanges(before, after, preRel: false).First().Should().Be(new PackageIdentity("a", NuGetVersion.Parse("3.0.0-a")));
        }