public void RestrictToBoundedRequirement() { BoundedVersionRequirement boundedRequirement; // When greater (1.1.*) boundedRequirement = new BoundedVersionRequirement("1.1"); Assert.Throws <IncompatibleRequirementException>( delegate { requirement.RestrictTo(boundedRequirement); } ); // When wider (1.*) boundedRequirement = new BoundedVersionRequirement("1"); Assert.AreSame(requirement.RestrictTo(boundedRequirement), requirement); // When lesser (0.9.*) boundedRequirement = new BoundedVersionRequirement("0.9"); Assert.Throws <IncompatibleRequirementException>( delegate { requirement.RestrictTo(boundedRequirement); } ); }
public void RestrictToBoundedRequirement() { BoundedVersionRequirement loseRequirement; IVersionRequirement targetRequirement; // When greater (4.0.*) loseRequirement = new BoundedVersionRequirement("4.0"); Assert.Throws <IncompatibleRequirementException>( delegate { requirement.RestrictTo(loseRequirement); } ); // When in between (2.0.*) loseRequirement = new BoundedVersionRequirement("2.0"); Assert.AreEqual(requirement.RestrictTo(loseRequirement), loseRequirement); // When lesser (0.9.*) loseRequirement = new BoundedVersionRequirement("0.9"); Assert.Throws <IncompatibleRequirementException>( delegate { requirement.RestrictTo(loseRequirement); } ); // When overlapping bottom loseRequirement = new BoundedVersionRequirement("1"); targetRequirement = new RangeVersionRequirement("1.5", "2"); Assert.AreEqual(requirement.RestrictTo(loseRequirement), targetRequirement); // When overlapping top loseRequirement = new BoundedVersionRequirement("3"); targetRequirement = new RangeVersionRequirement("3", "3.5"); Assert.AreEqual(requirement.RestrictTo(loseRequirement), targetRequirement); }
public void RestrictToBoundedRequirement() { BoundedVersionRequirement boundedRequirement = new BoundedVersionRequirement("1.0"); Assert.AreSame(requirement.RestrictTo(boundedRequirement), boundedRequirement); }