Can you provide the exact signature of the method you're trying to stub? --- Patrick Steele http://weblogs.asp.net/psteele
On Wed, Jul 10, 2013 at 4:03 PM, Tarpan <[email protected]> wrote: > Hi all, > > I cannot make "Do" work in the same sentence with "Ref" because "Ref" > takes a second argument "ReturnValue" and passes it into "Do". As so "Do" > cannot get access to the original value of the argument. > > Here is the example (forgive some syntax errors, don't have Visual Studio > with me) > > > var stub = MockRepository.GenerateStub<MyInterface>(); > stub.Stub(x => x.Method(Arg<DataTable>.Ref(Is.Anything(), *null* > ).Dummy)).Do(DoAction) > > ... > > private void DoAction(DataTable table) > { > // guess what? table is always *null *! > } > > > Anybody had the same issue before? Please help. > > Why ReturnValue is a required parameter? It should be optional. > > Alex > > -- > You received this message because you are subscribed to the Google Groups > "Rhino.Mocks" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/rhinomocks. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "Rhino.Mocks" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/rhinomocks. For more options, visit https://groups.google.com/groups/opt_out.
