public void GetMinorUpgradeVersions() { // Act IVersionSpec versionSpec1 = VersionUtility.GetUpgradeVersionSpec(new SemanticVersion("1.3"), PackageUpdateMode.Minor); IVersionSpec versionSpec2 = VersionUtility.GetUpgradeVersionSpec(new SemanticVersion("0.9"), PackageUpdateMode.Minor); IVersionSpec versionSpec3 = VersionUtility.GetUpgradeVersionSpec(new SemanticVersion("2.9.45.6"), PackageUpdateMode.Minor); // Assert Assert.Equal("(1.3, 2.0)", versionSpec1.ToString()); Assert.Equal("(0.9, 1.0)", versionSpec2.ToString()); Assert.Equal("(2.9.45.6, 3.0)", versionSpec3.ToString()); }
public NuGetPackageInfo(IPackage package, IVersionSpec dependency) { Id = package.Id; Version = package.Version.ToString(); vSpec = dependency.ToString(); }
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { IVersionSpec versionSpec = (IVersionSpec)value; return(versionSpec == null ? null : versionSpec.ToString()); }