Re: [RhinoMocks] Expect.call

2 views
Skip to first unread message
Message has been deleted

Ayende Rahien

unread,
May 15, 2008, 4:27:29 AM5/15/08
to Rhino...@googlegroups.com
This looks fine, can you post the complete test?

On Thu, May 15, 2008 at 11:21 AM, Skiv <vik...@gmail.com> wrote:

MockRepository mockery = new MockRepository();
IHtmlParser parser = (IHtmlParser) mockery.CreateMock(typeof
(IHtmlParser));
using (mockery.Record())
       {
               Expect.On(parser).Call(parser.PageText).Return(htmlPage);
               parser.GetPage(null);
               LastCall.IgnoreArguments().Throw(new ArgumentException("Error"));
               Expect.On(parser).Call(parser.PageText).Return(htmlPage);
       }
using (mockery.Playback())
       {
               query.ExecuteQuery();
       }
mockery.VerifyAll();

Problem is, that parser.GetPage didn't throw exception (what is
expected and wanted).
I tried get same result with Expect, but failed. What is correct way
to achieve this?

Thanks


Skiv

unread,
May 15, 2008, 4:32:53 AM5/15/08
to Rhino.Mocks

Ups, understood. It's my fault - I handled exception internally.
Sorry.
> > Thanks- Slėpti cituojamą tekstą -
>
> - Rodyti cituojamą tekstą -
Reply all
Reply to author
Forward
0 new messages