Please explain the problem? Are you looking for general guidance or
specific advice? As Ayende pointed out, code is almost always a must.
On Sun, Dec 7, 2008 at 9:15 PM, Berryl Hesh <[EMAIL PROTECTED]> wrote:
>
> I can see through a state based test that the stub() statement is
> doing it's job, and the Sut method is correctly replacing the
> service's property when it should. Yet my Rhino version of the test is
> a dud.
>
> Help on the fix any any other tips much appreciated - BH
>
> [Test]
> public void
> Pick_SelectionMade_SelectionAddedToServiceExclusionList() {
> var filterService =
> MockRepository.GenerateMock<IFilterService>();
> var presenter = new TimesheetPresenter(_view, _service);
> presenter.PickerWidget =
> MockRepository.GenerateMock<IProjectPickerWidget>();
>
> presenter.PickerWidget.Stub(x => x.Pick
> (null)).IgnoreArguments().Return(true);
> filterService.Expect(x => x.ExclusionList = null);
>
> presenter._onSelectProject();
>
> presenter.PickerWidget.AssertWasCalled(x => x.Pick(null),
> mo => mo.IgnoreArguments());
> filterService.AssertWasCalled(x =>x.ExclusionList = null,
> mo=>mo.IgnoreArguments());
> }
>
> Here's the TimesheetPresenter method I'm trying to test:
>
> public void _onSelectProject() {
> if (PickerWidget.Pick(_service)) {
> _service.ExceptionList = new List<LegacyProject>
> {PickerWidget.SelectedProject};
> }
> }
>
> Here's my failure msg:
>
> Rhino.Mocks.Exceptions.ExpectationViolationException:
> IFilterService.set_ExceptionList(any); Expected #1, Actual #0.
> at Rhino.Mocks.RhinoMocksExtensions.AssertWasCalled<T>(T mock,
> Action`1 action, Action`1 setupConstraints)
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Rhino.Mocks" group.
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
-~----------~----~----~----~------~----~------~--~---