NMock2 Type mismatch with CAB ServiceDependencies

Topics: CAB & Smart Client Software Factory
May 24, 2006 at 1:54 PM
originally posted by: ChrisHolmes

Has anyone run into this using NMock2?

Mockery mocks = new Mockery();
ITimecardService service = mocks.NewMock<ITimecardService>();
RootWorkItem.Services.Add<ITimecardService>(service);

Compiles fine. Running NUnit produces the following error:

System.ArgumentException : The provided type NMock2.Mockery+MockObject is not compatible with Services.Interfaces.ITimecardService.
Parameter name: typeToBuild
Mar 19, 2008 at 4:05 PM
Any further insight on this one?

I just ran into it. Works fine on one machine and fails on another.