I agree that "last in wins" makes more sense than "first in" looking at the example I think you might think that it will create a queue of stubbed responses.
2009/11/21 Iain Waddell <[email protected]> > This is the behaviour I was looking for when I started using Rhino Mocks. I > had to mess around because it didn't do this. I welcome the change. > > Iain > > 2009/11/21 bill richards <[email protected]> > > My money says that that is the behaviour I would expect >> >> On Nov 21, 5:11 pm, Tim Barcz <[email protected]> wrote: >> > Just to follow up on this I've looked into this and the problem is that >> I >> > could see this adding confusion. In the example below I made it work so >> > that the value of "true" was returned (last in wins). It seems like >> this >> > could break some fundamental assumptions about RhinoMocks since what I'm >> > doing is updating previous set expectations. >> > >> > Thoughts? >> > >> > public interface IFoo >> > { >> > bool ReadProperty { get; } >> > bool SetableProperty { get; set; } >> > >> > } >> > >> > [Test] >> > public void ShowReadable() >> > { >> > var order = MockRepository.GenerateStub<IFoo>(); >> > >> > order.Stub(x => x.ReadProperty).Return(false); >> > order.Stub(x => x.ReadProperty).Return(true); >> > >> > Console.WriteLine(order.ReadProperty ); >> > >> > } >> > >> > On Fri, Oct 30, 2009 at 2:37 PM, bill richards < >> [email protected] >> > >> > >> > >> > >> > >> > > wrote: >> > >> > > I would expect the same net behaviour in both cases, that being that I >> > > would expect any subsequent call to get_Property after stubbing >> > > set_Property to give me that LAST item that set_Property was stubbed >> > > with. >> > >> > > On Oct 30, 8:04 pm, Tim Barcz <[email protected]> wrote: >> > > > Is this what you would expect to see in the first example (where it >> > > > does not work...yet)? >> > >> > > > Tim >> > >> > > > On 10/30/09, bill richards <[email protected]> wrote: >> > >> > > > > The second example seems more intuitive to me ... if I've set a >> > > > > property's value that's what I expect to get when I use the >> getter. >> > >> > > > -- >> > > > Sent from my mobile device >> > >> > > > Tim Barcz >> > > > Microsoft C# MVP >> > > > Microsoft ASPInsiderhttp://timbarcz.devlicio.ushttp:// >> > >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]<rhinomocks%[email protected]> >> <rhinomocks%2bunsubscr...@googlegrouÂps.com> >> > > For more options, visit this group at >> > >http://groups.google.com/group/rhinomocks?hl=en >> > > -~----------~----~----~----~------~----~------~--~--- >> > >> > -- >> > Tim Barcz >> > Microsoft C# MVP >> > Microsoft ASPInsiderhttp://timbarcz.devlicio.ushttp:// >> www.twitter.com/timbarcz- 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]<rhinomocks%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/rhinomocks?hl=. >> >> >> > -- > 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]<rhinomocks%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/rhinomocks?hl=. > -- 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=.
