public void IsValidFail(IComparable value, IComparable maxValue, bool expected) { var attribute = new CannotBeGreaterThanAttribute(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 CannotBeGreaterThanAttribute(maxValue); Assert.AreEqual(expected, attribute.IsValid(value)); }