Hello,
I am trying to mock calls to an object instantiated by CreateInstanceAndUnwpap, i.e. the object is created by a factory in a different domain.
It does not seem to work. I have a code like this:
IMyInterface obj = MyFactory.GetObject();
using(RecordExpectations recorder = RecorderManager.StartRecording())
{
obj.DoSomething();
}
A call to DoSomething never gets mockes, i.e. the original method is called. Can this be because MyFactory.GetObject() returns an object of a type __TransparentProxy? And if this is case, is there anything I can do about it?