Quantcast
Channel: Fluent Validation for .NET
Viewing all articles
Browse latest Browse all 1917

New Post: when condition not working as expected

$
0
0
So your rule will only run when customer.IsPreferredCustomer is true, as specified in the when clause, but your test code sets it to false. Because of this, no rules will run and therefore the validator will be valid.

Did you mean for the validator to check customer.IsPreferedCustomer is false instead?

Jeremy

Viewing all articles
Browse latest Browse all 1917


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>