That explains it.You need to do mocks.Stub(x=>x.Fo()).WhenCalled();
On Sun, Feb 8, 2009 at 11:43 AM, Peter Morris <[email protected]> wrote: > Hi Oren > > I wanted to avoid "DO" because that requires me to create a method doesn't > it? I'd prefer something anonymous. > > Here is a screenshot showing the version I am using + which extensions are > available. > > PS: xheo's open response to your letter has comments enabled. I added a > comment myself which never appeared so they are obviously moderating the > comments added, which makes me wonder why they felt it appropriate to > approve that one that calls you an "arrogant prick" > > > Pete > > > > ----- Original Message ----- > From: "Ayende Rahien" <[email protected]> > To: <[email protected]> > Sent: Sunday, February 08, 2009 9:21 AM > Subject: [RhinoMocks] Re: Getting .Stub to return a new value each time it > is called > > > > It should be there in 3.5You can also try the Do() > > > > On Sun, Feb 8, 2009 at 10:49 AM, Peter Morris <[email protected]> > wrote: > > > >> > >> Thanks for the reply! > >> > >> I've downloaded the latest release from your site and WhenCalled isn't > >> available. Do I need to connect to your source control and build > myself, > >> or > >> should it be in a release? > >> > >> > >> Thanks > >> > >> > >> Pete > >> ==== > >> http://mrpmorris.blogspot.com > >> http://www.capableobjects.com - Think domain, not database > >> > >> ----- Original Message ----- > >> From: "Ayende Rahien" <[email protected]> > >> To: <[email protected]> > >> Sent: Saturday, February 07, 2009 10:52 PM > >> Subject: [RhinoMocks] Re: Getting .Stub to return a new value each time > >> it > >> is called > >> > >> > >> > WhenCalled( x=> x.ReturnValue = new MemoryStream()); > >> > > >> > On Sun, Feb 8, 2009 at 12:49 AM, Peter Morris <[email protected]> > >> wrote: > >> > > >> >> > >> >> mockFileSystem.Stub(fs => fs.CreateFileStream(null, FileMode.Append, > >> >> FileAccess.Write, FileShare.None)) > >> >> .IgnoreArguments() > >> >> .Return(new MemoryStream()); > >> >> > >> >> Every time I call mockFileSystem.CreateFileStream I will get back the > >> >> same instance of the MemoryStream, can someone please tell me how to > >> >> return a new MemoryStream each time? > >> >> > >> >> > >> >> Thanks > >> >> > >> >> > > >> >> > >> > > >> > > > >> > > >> > >> > >> > > >> > > > > > > > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
