I don't remember the exact syntax, but I once saw something like this: mockViewEngine.Stub((a,b,c,d)=>mockViewEngine.FindView(a,b,c,d)).Return (...);
basically, if you want to ignore argument, you pass it as expression' delegate argument, if you wanted to not ignore a certain one, like - you want to expect 3rd one to be "foo", you'd do: mockViewEngine.Stub((a,b,c)=>mockViewEngine.FindView (a,b,"foo",c)).Return(...); This would however lead to overload explosion, as you'd have to accommodate for 0-many generic arguments, plus I don't know had this would work in more complicated scenarios. On 24 Wrz, 15:49, Tim Barcz <[email protected]> wrote: > Curious about people's preference. Which would you prefer to a) read b) > write ? > > 1. mockViewEngine.Stub(x => > x.FindView(Arg<ControllerContext>.Is.Anything, Arg<string>.Is.Anything, > Arg<string>.Is.Anything, Arg<bool>.Is.Anything)).Return(...); > 2. mockViewEngine.Stub(x => x.FindView(null, > null,null,false)).IgnoreArguments().Return() > > -- > Tim Barcz > 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] For more options, visit this group at http://groups.google.com/group/rhinomocks?hl=en -~----------~----~----~----~------~----~------~--~---
