public void RestrictToExactRequirement() { ExactVersionRequirement exactRequirement; // When greater (1.0.1!) exactRequirement = new ExactVersionRequirement("1.0.1"); Assert.Throws <IncompatibleRequirementException>( delegate { requirement.RestrictTo(exactRequirement); } ); // When same (1.0!) exactRequirement = new ExactVersionRequirement("1.0"); Assert.AreSame(requirement.RestrictTo(exactRequirement), requirement); // When lesser (0.9.9!) exactRequirement = new ExactVersionRequirement("0.9.9"); Assert.Throws <IncompatibleRequirementException>( delegate { requirement.RestrictTo(exactRequirement); } ); }
public void RestrictToExactRequirement() { ExactVersionRequirement exactRequirement = new ExactVersionRequirement("1.0"); Assert.AreSame(requirement.RestrictTo(exactRequirement), exactRequirement); }