public void IsValidFail(IComparable value, IComparable maxValue, bool expected) { var attribute = new MustBeGreaterThanAttribute(maxValue); try { attribute.IsValid(value); Assert.Fail(); } catch (FormatException ex) { Assert.AreEqual("Input string was not in a correct format.", ex.Message); } }
public void IsValid(IComparable value, IComparable maxValue, bool expected) { var attribute = new MustBeGreaterThanAttribute(maxValue); Assert.AreEqual(expected, attribute.IsValid(value)); }