question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Testing PropertyValidators

See original GitHub issue

ShouldHaveChildValidator 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:closed
  • Created 7 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kazpercommented, Aug 23, 2016

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.

0reactions
kazpercommented, Aug 29, 2016

Thanks again for the thorough answers with your point of view!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found