public void ValidationPassesWhenArrayLengthIsWithinBoundaries(ICollection <int> array) { var attribute = new IntArrayLengthAttribute("Field", 3, 1); var isValid = attribute.IsValid(array); Assert.True(isValid); }
public void ValidationFailsWhenArrayLengthIsNotBetweenOneAndThree(ICollection <int> array) { var attribute = new IntArrayLengthAttribute("Field", 3, 1); var isValid = attribute.IsValid(array); Assert.False(isValid); }
public void ValidationFailsWhenMinLengthIsNotSetAndArrayIsNull() { List <int> array = null; var attribute = new IntArrayLengthAttribute("Field", 3); var isValid = attribute.IsValid(array); Assert.False(isValid); }
public void ValidationPassesWhenMinLengthIsNotSetAndArrayIsEmpty() { var array = new List <int>(); var attribute = new IntArrayLengthAttribute("Field", 3); var isValid = attribute.IsValid(array); Assert.True(isValid); }