Replies: 1 comment
-
Hm... you may be onto something here. I guess a source generator could emit that for you... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Given any constructor of a class I want to test, such as:
Can you think of a good way to automatically generate a MakeSut method like the following? I think this is the most tedious part of writing tests for me.
I have found this to be a good pattern, as the out-parameters let me
Setup
what I want and ignore what I don't care about when doing non-strict tests. Having this method with the out parameters lets me instantiate all manner of different SUTs easily like...I've explored doing this using Resharper's Custom Patterns, but it seems too limited to accomplish such a thing. So how would you go about writing something that could generate the code for such a MakeSut method from any constructor?
(Or am I barking up the wrong tree and you know of a better pattern to instantiate SUTs with all dependencies mocked and every mock available for
.Setup
?)Beta Was this translation helpful? Give feedback.
All reactions