Is the method IsModeExist() virtual? --- Patrick Steele http://weblogs.asp.net/psteele
On Wed, Oct 3, 2012 at 10:32 AM, Павел Лужецкий <supo...@gmail.com> wrote: > 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 rhinomocks@googlegroups.com. > To unsubscribe from this group, send email to > rhinomocks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rhinomocks?hl=en. -- You received this message because you are subscribed to the Google Groups "Rhino.Mocks" group. To post to this group, send email to rhinomocks@googlegroups.com. To unsubscribe from this group, send email to rhinomocks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rhinomocks?hl=en.