public DependencyNode(DependencyNode parentNode, string packageId, string framework, VersionRangeExtended allowedVersions) { _parentNode = parentNode; PackageId = packageId; Framework = framework; AllowedVersions = allowedVersions; }
public UnresolvedPackage(string packageId, string framework, VersionRangeExtended allowedVersions) { Guard.NotNull(packageId, nameof(packageId)); PackageId = packageId; AllowedVersions = allowedVersions; Framework = framework; }
public void Satisfies_Test(string version, string vToCheck, bool expectedResult) { var range = VersionExtensions.GetVersionRangeFromDependency(version); var checkVersion = NuGet.Versioning.NuGetVersion.Parse(vToCheck); var result = new VersionRangeExtended(range).Satisfies(checkVersion); Assert.Equal(expectedResult, result); }
public void IsBetter_Test(string rangeString, string currentString, string consideringString, bool expectedResult) { var range = VersionExtensions.GetVersionRangeFromDependency(rangeString); var current = NuGet.Versioning.NuGetVersion.Parse(currentString); var considering = NuGet.Versioning.NuGetVersion.Parse(consideringString); var result = new VersionRangeExtended(range).IsBetter(current, considering); Assert.Equal(expectedResult, result); }
public DependencyResolverImplementation(IWriter writer, PackageManifestRoot rootManifest, IRepository[] activeRepositories, string releaseLabel) { _cache = new DependencyResolverCache(GetAllAvailableVersions, rootManifest.Framework); _writer = writer; _activeRepositories = activeRepositories; var version = new VersionRangeExtended(rootManifest.Version) { ReleaseLabel = releaseLabel }; _rootDependencyNode = new DependencyNode(null, rootManifest.PackageId, rootManifest.Framework.GetShortFolderName(), version); _rootDependencyNode.MarkAsRoot(rootManifest); }
[InlineData("1.1.1-beta1", "1.1.1", null)] // Not supported public void Satisfies_WithExtraLabel_Test(string version, string vToCheck, bool?expectedResult) { var range = VersionExtensions.GetVersionRangeFromDependency(version); var checkVersion = NuGet.Versioning.NuGetVersion.Parse(vToCheck); bool?result = null; try { result = new VersionRangeExtended(range) { ReleaseLabel = "ABC" }.Satisfies(checkVersion); } catch { Assert.Null(expectedResult); } Assert.Equal(expectedResult, result); }
private static string ToPunditFileSearchVersion(VersionRangeExtended range) { return(ToPunditFileSearchVersion(range.NuGetVersionRange)); }