Hello all!
I have a trouble in using PartialMock for my tests.
When test comes to:
Expect.Call(cameraWorkflowService.IsModelExist(0)).IgnoreArguments().Return(true);
My test crushes coz class is not properly initialized and it calls
original cameraWorkflowService.IsModelExist method not a fake one.
Is there any way to block default method implementation from executing?
My test code:
var camRep = MockRepository.GenerateMock<ICamerasRepository>();
var modelRep =
MockRepository.GenerateMock<ICameraModelsRepository>();
var adrrRep =
MockRepository.GenerateMock<IAddressesRepository>();
var camera = MockRepository.GenerateStub<ICamera>();
var mocks = new MockRepository();
var cameraWorkflowService =
mocks.PartialMock<CameraWorkflowService>(camRep, adrrRep, modelRep);
Expect.Call(cameraWorkflowService.IsModelExist(0)).IgnoreArguments().Return(true);
cameraWorkflowService.Replay();
cameraWorkflowService.CheckBaseData(camera);
Thanx!
--
You received this message because you are subscribed to the Google Groups
"Rhino.Mocks" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rhinomocks/-/Vjp2C5ThoxMJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rhinomocks?hl=en.