and whoops, that last line should read ....
pageMock.VerifyAllExpectations(). (sorry about that, typing too
quickly)

On Sep 15, 1:11 pm, bill richards <[email protected]>
wrote:
> My understanding of your problem here is that you are actually testing
> your IEditPageView implementation.
>
> The problem you are experiencing, it seems therefore, is because you
> are trying to run your tests on a mock object.
>
> Instead, you should be mocking your Page. Something like the
> following:
>
> var pageMock = MockRepository.GenerateStub<Page>();
> pageMock.Expect(p =>p.Name).Return(knownValue1);
> pageMock.Expect(p=>p.Author).Return(knownValue2);
>
> IEditPageView view = new ConcreteImplementationOf( ... injected
> dependencies);
>
> view.FillPage(pageMock);
>
> view.VerifyAllExpectations();
>
> hope that helps.
>
> On Sep 15, 1:00 pm, shapovalov <[email protected]> wrote:
>
>
>
> > Hello,
>
> > I need to fill variable as a parameter to method.
> >             IEditPageView view =
> > MockRepository.GenerateMock<IEditPageView>();
> >             view.Expect(x => x.FillPage(page)); // this page variable
> > was created in another class I need to fill properties of variable for
> > this method.
>
> > When called method FillPage it must fill page properties. Real
> > FillPage method looks like
> > void FillPage(Page page)
> > {
> > page.Name = txtName.Text;
> > page.Author = txtAuthor.Text;
>
> > }
>
> > I don't know how I can mock this method.
>
> > Can anybody tell me if it possible to do such work with Rhino mocks.
>
> > Thanks,
> > Alexander.- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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