public void Returns_error_message_with_replacements() { var requirement = new StringAtMostRequirement(5); requirement.Message = "{0}#{1}"; Assert.Equal("5#6", requirement.Check("123456").ToArray()[0].Message); }
public void Returns_null_if_value_is_smaller_or_equal_to_the_max_length() { var requirement = new StringAtMostRequirement(5); Assert.Empty(requirement.Check("1234")); Assert.Empty(requirement.Check("12345")); }
public void Returns_null_if_value_is_null() { var requirement = new StringAtMostRequirement(5); Assert.Empty(requirement.Check(null)); }
public void Returns_error_if_value_is_too_long() { var requirement = new StringAtMostRequirement(5); Assert.NotEmpty(requirement.Check("123456")); }
public void Returns_error_message_with_replacements() { var requirement = new StringAtMostRequirement(5); requirement.Message = "{0}#{1}"; Assert.Equal("5#6",requirement.Check("123456").ToArray()[0].Message); }