the inline argument constraints let you read from left to right and it all makes sense, the IgnoreAllArguments requires you to get past all the nulls/falses etc and then only later do you understand why. It's basically a lot more self explanatory. Also you can see by looking the types of all the arguments
I find that the majority of cases I want to setup stubs where parameters are ignored and yet it takes a lot of typing and angle brackets to do this. Also in many ways when the value of the argument is unimportant why should the type of the argument be so important? I must admit when reading it it's kind of nice to be able to see all the argument types (particularly when laid out prettily like Iain shows), but I maintain that this really only adds anything when you care about the value of the parameter. If I don't care about the value then I almost certainly don't care about the type. Does that answer your questions? 2009/9/24 Tim Barcz <[email protected]>: > Alex, > > Thanks for the feedback. A few questions though > > "...for someone not familiar I reckon (a) is better" -- what leads you to > this conclusion? I curious about this. > Why Arg.Ignore? Shorter? > > > On Thu, Sep 24, 2009 at 8:55 AM, Alex McMahon <[email protected]> wrote: >> >> I prefer to write (b) and as someone who knows Rhino Mocks I prefer to >> read (b) as well, for someone not familiar I reckon (a) is better. >> >> If it was possible I'd like to have: >> mockViewEngine.Stub(x => x.FindView(Arg.Ignore, Arg.Ignore, >> Arg.Ignore, Arg.Ignore)).Return(...); >> >> 2009/9/24 Tim Barcz <[email protected]>: >> > Curious about people's preference. Which would you prefer to a) read b) >> > write ? >> > >> > mockViewEngine.Stub(x => x.FindView(Arg<ControllerContext>.Is.Anything, >> > Arg<string>.Is.Anything, Arg<string>.Is.Anything, >> > Arg<bool>.Is.Anything)).Return(...); >> > mockViewEngine.Stub(x => x.FindView(null, >> > null,null,false)).IgnoreArguments().Return() >> > >> > -- >> > Tim Barcz >> > Microsoft ASPInsider >> > http://timbarcz.devlicio.us >> > http://www.twitter.com/timbarcz >> > >> > >> > > >> > >> >> > > > > -- > Tim Barcz > Microsoft ASPInsider > http://timbarcz.devlicio.us > http://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] For more options, visit this group at http://groups.google.com/group/rhinomocks?hl=en -~----------~----~----~----~------~----~------~--~---
