Testing PropertyValidators
See original GitHub issueShouldHaveChildValidator test-helper does not seem to work for PropertyValidators. For example, it seems natural to do this validator.ShouldHaveChildValidator(m => m.Email, typeof(EmailValidator));
for the built-in email PropertyValidator.
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Testing FluentValidation PropertyValidator
I know I can test the Validator that's using the PropertyValidator for specific errors but I'd rather test true/false just on the property ......
Read more >Testing PropertyValidators · Issue #314 · FluentValidation ...
Yes, that's the correct behaviour. It's for testing the presence of a child validator, not a PropertyValidator.
Read more >Custom Validators — FluentValidation documentation
This can be done by writing a class that inherits from the abstract PropertyValidator<T,TProperty> class (this is how all of FluentValidation's built-in ...
Read more >Testing Spring Boot @ConfigurationProperties
Learn how to test configuration classes in Spring Boot that rely on the ... private static Validator propertyValidator; @BeforeAll public ...
Read more >[Solved]-Testing FluentValidation PropertyValidator-C#
My work around was to create another IsValid method and have the protected IsValid call through to it. public class MyValidator: PropertyValidator {...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Would it be viable to create a helper for testing the presence of PropertyValidators? Seems tedious to test the correct behaviour of PropertyValidators every time I use them.
Thanks again for the thorough answers with your point of view!