Repository navigation
Replies: 1 comment 1 reply
|
@elTRexx you'll need to make it virtual so it can be intercepted by the mock |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Depends on how
Mock.Wrap()is conceived, but imo I was expecting that a wrapped mock to also wrap the properties, not only the methods ?For example lets say I have this interface and implementing class :
Then I was expecting to use mock of
MyClassin my test method like this :and that should be OK.
But instead the mocked
MyMethod()is called this way :_wrappedInstance.MyIntreturn0(default value) as when setting thexxx_MyClassWrapMockImpl.MyIntproperty, via the 'arranging'mockedObject.MyInt = 256;instruction, does not re-routing to also set its_wrappedInstance.MyIntcounterpart.I was expecting something (typing out of my mind here, nothing tested) like this to be generated :
So calling
_wrappedInstance.MyMethod();after 'arranging'mockedObject.MyInt = 256;will also have rerouted setting_wrappedInstance.MyIntto 256 under the hood.All reactions