Hi
thanks for quick response, however provided Fake overload with Constructor.WillBeCalled will call ctor of SPSite, which is not what i want (in fact, it will break tests on build machine, where Sharepoint is not installed).
What I want is to return different fakes when different ctors are invoked (with specific, exact arguments), just like when using Isolate.WhenCalled().WithExactArguments().
Can i achieve this with TypeMock, without actually calling original ctors (as is currently with Constructor.WillBeCalled).
Method under test looks something like this:
void F1()
{
new SPSite(url1).OpenWeb()
new SPSite(url1).OpenWeb()
}
I want to test this method and must set up different expectations on each returned SPSite, based on ctor arguments (and calling original objects even partually is not an option)