I do see where there is some confusion. But from my perspective (the
way I've used RhinoMocks), it doesn't make much sense to Stub a void
method on an interface (unless I have specific processing to do). If
you just want to make sure a method was called ("AssetWasCalled"), why
stub out its implementation if it's void and doesn't need to return a
canned response?
I think your first example would work if you removed the .Stub call.
---
Patrick Steele
http://weblogs.asp.net/psteele
On Thu, Apr 29, 2010 at 9:12 AM, NateGQG <[email protected]> wrote:
> Yes it helps.
>
> And you are correct, we are stubbing the IJobQueue and using depency
> injection so we can test various parts of the main processing class,
> so the AddNewJobQueueRow method is called from
> CreateJobQueueForCustomer method.
>
> However, I still have one question, isn't the method AddNewJobQueueRow
> still getting called whether I stub it or create an expectation for
> it? To me, whether Rhino Mocks intercepts it and executes my stubbed
> implementation or the actual original implementation is used, the
> method is still getting called. So from Rhino Mock's perspective,
> providing a stub for a method and then executing that stub is not the
> same as executing the actual method when we're testing for
> AssertWasCalled?
>
> Nate
>
> --
> 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.
>
>
--
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.