-
By default when you create new Mock, you cannot use existing class instance - meanwhile in Moq v 4 - I've noticed that I do understand that Moq v5 is slightly different than Moq v4 - but I think its possible to use same concept as well. So maybe there should be alternative constructor:
Which would allow to pass class instance to be proxied. This feature would be useful in case if want to use majority of same functionality as |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
That's basically what |
Beta Was this translation helpful? Give feedback.
-
I've harvested all Moq tests forth and back, and of course checked through Intrested particularly in instance. |
Beta Was this translation helpful? Give feedback.
-
No, but you wouldn't need to delegate to some object instance in the first place, if all you want is to reuse some or all of the existing functionality from the mocked (base) class. That's what |
Beta Was this translation helpful? Give feedback.
No, but you wouldn't need to delegate to some object instance in the first place, if all you want is to reuse some or all of the existing functionality from the mocked (base) class. That's what
CallBase
gives you.