Ejemplo n.º 1
0
        public void CountCurrentVersions_WhenThereIsOneUpdate()
        {
            var currentPackages = new List <PackageInProject>
            {
                new PackageInProject("foo", "1.0.1", PathToProjectOne())
            };

            var lookupResult = new PackageLookupResult(VersionChange.Major, LatestFooMetadata(), null, null);
            var updates      = new PackageUpdateSet(lookupResult, currentPackages);

            Assert.That(updates.CountCurrentVersions(), Is.EqualTo(1));
        }
Ejemplo n.º 2
0
        private static long Priority(PackageUpdateSet update)
        {
            long countCurrentVersions = update.CountCurrentVersions();
            long countUsages          = update.CurrentPackages.Count;
            var  versionChangeScore   = ScoreVersionChange(update);
            var  ageScore             = ScoreAge(update);

            long score = countCurrentVersions;

            score = score * Shift;
            score = score + countUsages;
            score = score * Shift;
            score = score + versionChangeScore + ageScore;
            return(score);
        }
        private void WriteLine(StreamWriter writer, PackageUpdateSet update)
        {
            var occurences    = update.CurrentPackages.Count;
            var versionsInUse = update.CurrentPackages
                                .Select(p => p.Version)
                                .ToList();

            var lowest  = versionsInUse.Min();
            var highest = versionsInUse.Max();

            var highestDate   = DateFormat.AsUtcIso8601(update.Packages.Major.Published);
            var packageSource = update.Selected.Source;

            writer.WriteLine($"{update.SelectedId},{occurences},{update.CountCurrentVersions()},{lowest},{highest},{update.HighestVersion},{highestDate},{packageSource}");
        }
Ejemplo n.º 4
0
        private void WriteLine(PackageUpdateSet update)
        {
            var occurrences   = update.CurrentPackages.Count;
            var versionsInUse = update.CurrentPackages
                                .Select(p => p.Version)
                                .ToList();

            var lowest  = versionsInUse.Min();
            var highest = versionsInUse.Max();

            var packageSource = update.Selected.Source;

            var majorData = PackageVersionAndDate(lowest, update.Packages.Major);
            var minorData = PackageVersionAndDate(lowest, update.Packages.Minor);
            var patchData = PackageVersionAndDate(lowest, update.Packages.Patch);

            _writer.WriteLine(
                $"{update.SelectedId},{packageSource}," +
                $"{occurrences},{update.CountCurrentVersions()},{lowest},{highest}," +
                $"{majorData},{minorData},{patchData}");
        }
Ejemplo n.º 5
0
 private int Priority(PackageUpdateSet update)
 {
     return(update.CountCurrentVersions());
 }