thanks,

I managed to do it yesterday with Expect instead of Stub, i tried it
now and it worked as you mentioned it above :).
what is the difference between Expect and Stub....Repeat.Once();

thanks once more



On Nov 14, 5:21 am, "Ayende Rahien" <[EMAIL PROTECTED]> wrote:
> .Repeat.Once()
>
> On Fri, Nov 14, 2008 at 2:02 AM, kaza <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > i want to get different results when I call the method for the second
> > time, (this was default behaviour in RC1 i think)
>
> > for example:
> > Named g1 = new Named() { Name = "G1" };
> > Named g2 = new Named() { Name = "G2" };
> > INamedRepository repository =
> > MockRepository.GenerateStub<INamedRepository>();
>
> > repository.Stub(action => action.GetNamed(null)).IgnoreArguments
> > ().Return(g1);
> > repository.Stub(action => action.GetNamed(null)).IgnoreArguments
> > ().Return(g2);
>
> > var v1 = repository. GetNamed("");
> > Assert.AreSame(g1.Name, v1.Name);
>
> > var v2 = repository. GetNamed("");
> > Assert.AreSame(v2.Name, g2.Name);
>
> > var v3 = repository. GetNamed(g => g.GroupId == 2);
> > Assert.IsNul(v3);
>
> > thanks
> > almir
--~--~---------~--~----~------------~-------~--~----~
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