What am I doing wrong? I am trying to assert a method is being invoked
with a NameValueCollection argument containing a specific element
value.

No matter what constraint I compare on I never get a match, for
example:

restCommand.AssertWasCalled(
    cmd =>
    cmd.Post(
        Arg<NameValueCollection>.List.Element(0, Is.Equal("xxx"))
    )
);

Or even:

restCommand.AssertWasCalled(
    cmd =>
    cmd.Post(
        Arg<NameValueCollection>.List.Element(0, Is.Anything)
    )
);

These both fail.

But when I manually inspect the arguments using something like:

var theSuppliedParams = (NameValueCollection)
    restCommand.GetArgumentsForCallsMadeOn(
        cmd => cmd.Post(Arg<NameValueCollection>.Is.Anything)
    )[0][0];

Assert.AreEqual("xxx", theSuppliedParams[0]);

I am back in business. Any clues?

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

Reply via email to