Is below what you are looking for? Arg<NameValueCollection>.Matches(c=>(c[0]=="xxx"))
This requires Linq so it won't work if you are targeting to 2.0, but you can use Matches(Is.Matching(...)) Instead. HTH Sent from my Verizon Wireless BlackBerry -----Original Message----- From: "ben.biddington" <[email protected]> Date: Wed, 5 Aug 2009 01:49:59 To: Rhino.Mocks<[email protected]> Subject: [RhinoMocks] Re: Arg<T>.List.Element -- can't get it to work It is because NameValueCollection does not implement IList. This is not apparent because it just absorbed by ListElement.Eval: // See: Rhino.Mocks.Constraints.ListElement (v3.5.0.1337) public override bool Eval(object obj){ IList list = obj as IList; return (((list != null) && ((this._index >= 0) && (this._index < list.Count))) && this._constraint.Eval(list[this._index])); } So, even though this compiles: Arg<NameValueCollection>.List.Element(0, Is.Equal("xxx")) I get unexpected results. With that in mind then, is my only option to use GetArgumentsForCallsMadeOn? <bb/> On 5 Aug, 08:36, Iain Waddell <[email protected]> wrote: > > What am I doing wrong? I am trying to assert a method is being invoked > > with a NameValueCollection argument containing a specific element > > value. > > I think a complete test case would help. > > Iain --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
