예제 #1
0
        public void MatchEqualOrHigher2Reversed()
        {
            var dvm = new DependencyVersionMatcher();

            var result = dvm.MatchesConstraints(new[] { "1.0.0.5", "1.0.0.4" }, ">= 1.0.0.4");

            result.Should().Be("1.0.0.5");
        }
예제 #2
0
        public SpecificVersion GetPackage(SpecificVersion package)
        {
            lock (Packages) {
                if (!Packages.ContainsKey(package.Name))
                {
                    return(null);
                }
                var packages = Packages[package.Name];

                //if (package.Version == null && package.Branch == null)
                //  return GetLatest(package, packages);

                if (packages.Contains(package.VersionData))
                {
                    return(package);
                }
                var m = _dependencyVersionMatcher.MatchesConstraints(packages, package.Version.ToString(),
                                                                     package.Branch);
                return(m == null ? null : new SpecificVersion(package.Name, m));
            }
        }