Thanks for the suggestion.
Personally, I'm not keen on this approach so I don't have any plans on implementing it - this is really testing the internal implementation of the validator which I'd tend to avoid as it leads to brittle tests. I find it better to simply test given a particular input, is the validator valid or not as this makes the tests far less brittle. In this situation, I'd have tests for the following tests:
Personally, I'm not keen on this approach so I don't have any plans on implementing it - this is really testing the internal implementation of the validator which I'd tend to avoid as it leads to brittle tests. I find it better to simply test given a particular input, is the validator valid or not as this makes the tests far less brittle. In this situation, I'd have tests for the following tests:
- Name contains numbers -> not valid
- Name is 100 characters -> not valid
- Name greater than 100 characters -> not valid
- Name shorter than 100 characters -> valid
-
Name doesn't contain numbers -> valid
(you could even go further, and have combinations of the above)