What is the usage scenario for this...seems odd to have an expectation and a
stub all at the same time.

Tim

On Thu, Jun 11, 2009 at 12:05 PM, Shane C <[email protected]> wrote:

>
> I seem to be going crazy because I swear that the following was
> legal...
>
> [SetUp]
> public void BeforeEachTest()
> {
>            m_EngineMock = MockRepository.GenerateMock<Engine>();
>
>            m_EngineMock.Stub(stub => stub.Execute(null, null)
>                       .IgnoreArguments()
>                       .Return(new Result());
> }
>
> // Tests that need the stub to exist...
>
> [Test]
> public void TestThatVerfiesTheEngineIsBeingExecuted()
> {
>    m_EngineMock.Expect(mock = mock.Execute(var1, var2)
>            .Repeat.AtLeastOnce()
>            .Return(new Result());
>
>    m_SUT.Execute();
>
>    m_EngineMock.VerifyAllExpectations();
> }
>
> When I try to do something similar to this my expectation never
> passes.  The stub is blocking it but I could have sworn I'd done this
> before...
> >
>


-- 
Tim Barcz
ASPInsider
http://timbarcz.devlicio.us
http://www.twitter.com/timbarcz

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to