public void ParseExactRequirement() { IVersionRequirement parsed = VersionParser.ParseRequirement("1.2.3!"); Assert.IsTrue(parsed is ExactVersionRequirement); Assert.AreEqual((parsed as ExactVersionRequirement).expected, new Version { Major = 1, Minor = 2, Patch = 3 }); }
public void ParseMinimalRequirement() { IVersionRequirement parsed = VersionParser.ParseRequirement("1.2+"); Assert.IsTrue(parsed is MinimalVersionRequirement); Assert.AreEqual((parsed as MinimalVersionRequirement).minimal, new Version { Major = 1, Minor = 2 }); }
public void ParseBoundedRequirement() { IVersionRequirement parsed = VersionParser.ParseRequirement("1.2.*"); Assert.IsTrue(parsed is BoundedVersionRequirement); Assert.AreEqual((parsed as BoundedVersionRequirement).lower, new Version { Major = 1, Minor = 2 }); }
public void DoNotParseInvertedRangeRequirement() { Assert.Throws <System.ArgumentException>( delegate { VersionParser.ParseRequirement("3.4,1.2"); } ); }
public void ParseLoseRequirement() { IVersionRequirement parsed = VersionParser.ParseRequirement("1.2"); Assert.IsTrue(parsed is LoseVersionRequirement); Assert.AreEqual((parsed as LoseVersionRequirement).stub, new Version { Major = 1, Minor = 2 }); }
public void DoNotParseWrongRequirement() { // QUESTION: Should we not fail there? Assert.Throws <System.ArgumentException>( delegate { VersionParser.ParseRequirement("not.a.requirement"); } ); }
public void ParseRangeRequirement() { IVersionRequirement parsed = VersionParser.ParseRequirement("1.2,3.4"); Assert.IsTrue(parsed is RangeVersionRequirement); Assert.AreEqual((parsed as RangeVersionRequirement).lower, new Version { Major = 1, Minor = 2 }); Assert.AreEqual((parsed as RangeVersionRequirement).upper, new Version { Major = 3, Minor = 4 }); }
public DependencyNode(string name, string version, string repository, SkipInstallSpec[] skips, OverrideDestinationSpec[] overrides, List <DependencyNode> dependencies) { this.name = name; this.requirement = VersionParser.ParseRequirement(version); this.repository = repository; this.dependencies = dependencies; this.skips = skips; this.overrides = overrides; index = -1; lowlink = -1; }
public void ParseEmptyRequirement() { Assert.IsTrue(VersionParser.ParseRequirement("") is NoRequirement); }