public void IsValidFail(IComparable value, IComparable min, IComparable max, bool inclusive) { var attribute = new CannotBeBetweenAttribute(min, max, inclusive); try { attribute.IsValid(value); Assert.Fail(); } catch (ArgumentException ex) { Assert.AreEqual($"Value must be of type {max.GetType().Name}.", ex.Message); } }
public void IsValid(IComparable value, IComparable min, IComparable max, bool inclusive, bool expected) { var attribute = new CannotBeBetweenAttribute(min, max, inclusive); Assert.AreEqual(expected, attribute.IsValid(value)); }