Hi Jeremy
Thanks for your response.
I am calling the validator with ruleset in my code like this:
I will try your suggestion anyway just for interest's sake but thanks for the explanation regarding how I should be testing.
I do have unit tests that verify the validators behave correctly but I wasn't sure if in my service/controller/integration/somethingelse tests I should replicate all the rule checking... or just ensure that the validator was called correctly and trust the rest. What is the best way to verify that I have correctly called my validators where I need to (and not just totally left out code accidentally)? What do other people do for this sort of thing.. ? I have a lot to learn about testing!
Sorry I know that this is really off topic advice (and I might not be wording my question terribly well either). It's so much easier asking someone directly "what should I do" sometimes than trying to garner best practices online, especially when I am only just figuring out the differences between mocks, dummies, stubs etc etc.. I used to use the words almost interchangeably and I know I still get it wrong now.
the above can be taken as rhetorical questions, if it's too tiring to answer :)
thanks again.
Mariellen
Thanks for your response.
I am calling the validator with ruleset in my code like this:
var results = _userDtoValidator.Validate(userDto, ruleSet: Rulesets.UserOptOutOfEmails);
where RuleSets.UserOptOutOfEmails is just the name of the rulesetI will try your suggestion anyway just for interest's sake but thanks for the explanation regarding how I should be testing.
I do have unit tests that verify the validators behave correctly but I wasn't sure if in my service/controller/integration/somethingelse tests I should replicate all the rule checking... or just ensure that the validator was called correctly and trust the rest. What is the best way to verify that I have correctly called my validators where I need to (and not just totally left out code accidentally)? What do other people do for this sort of thing.. ? I have a lot to learn about testing!
Sorry I know that this is really off topic advice (and I might not be wording my question terribly well either). It's so much easier asking someone directly "what should I do" sometimes than trying to garner best practices online, especially when I am only just figuring out the differences between mocks, dummies, stubs etc etc.. I used to use the words almost interchangeably and I know I still get it wrong now.
the above can be taken as rhetorical questions, if it's too tiring to answer :)
thanks again.
Mariellen