public async Task TestGetLatestWithMin()
        {
            var settings = new NuGetVersions.Filter
            {
                MinimumVersion = NuGetVersion.Parse("2.0.0")
            };

            var version = await NuGetVersions.GetLatestAsync("Xamarin.Forms", settings);

            Assert.True(version >= NuGetVersion.Parse("3.1.0.637273"));
        }
        public async Task TestGetLatestWithMax()
        {
            var settings = new NuGetVersions.Filter
            {
                MaximumVersion = NuGetVersion.Parse("3.1.0")
            };

            var version = await NuGetVersions.GetLatestAsync("Xamarin.Forms", settings);

            Assert.Equal(NuGetVersion.Parse("3.0.0.561731"), version);
        }
Exemple #3
0
        public async Task TestGetLatestWithRange()
        {
            var version = await NuGetVersions.GetLatestAsync(
                "Microsoft.Extensions.DependencyInjection",
                new NuGetVersions.Filter
            {
                VersionRange = VersionRange.Parse("5.0.0")
            });

            Assert.Equal(NuGetVersion.Parse("5.0.0"), version);
        }
        public async Task TestGetLatestWithReversedMaxMin()
        {
            var settings = new NuGetVersions.Filter
            {
                MinimumVersion = NuGetVersion.Parse("3.1.0"),
                MaximumVersion = NuGetVersion.Parse("2.0.0")
            };

            var version = await NuGetVersions.GetLatestAsync("Xamarin.Forms", settings);

            Assert.Null(version);
        }
Exemple #5
0
        public async Task TestGetLatestWithPreReleaseRange(string range, string matched)
        {
            var version = await NuGetVersions.GetLatestAsync(
                "Microsoft.Extensions.DependencyInjection",
                new NuGetVersions.Filter
            {
                IncludePrerelease = true,
                VersionRange      = VersionRange.Parse(range),
            });

            Assert.Equal(NuGetVersion.Parse(matched), version);
        }
        public async Task TestGetLatest()
        {
            var version = await NuGetVersions.GetLatestAsync("Xamarin.Forms");

            Assert.True(version >= NuGetVersion.Parse("3.1.0.637273"));
        }