Yes if the number of fields on the page is small I can do the same
way,
but on my page I have about 30 fields.
and I prefer to create instance of object which contains my fields in
my business logic class and pass this class to webpage and webpage
method must fill this variable with values.
So I need to mock this Fill method, and I can't understand how.
Is it possible to mock methods like this?
void FillPage(Page page)
{
page.Name = txtName.Text;
page.Author = txtAuthor.Text;

}

inside of my mock all properties of the variable must be filled.
Or It's not possible?
Maybe I can use RefOut but I don'n understand how can I use it

Please suggest.
Thanks


On 15 сен, 16:11, 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 aparameterto 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.
--~--~---------~--~----~------------~-------~--~----~
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