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
-~----------~----~----~----~------~----~------~--~---