I assume you need to define the stub which returns expectedResult
when the second parameter has the right values in the fields Id
and Name
.
But now you stub is defined to return expectedResult
when the second parameter is the same as the data
object.
If so, then you just need to modify the Stub
definition:
myClass
.Stub(x => x.MyMethod(
Arg<string>.Is.Equal("hello"),
Arg<IDictionary<string, object>>.Matches(d => d["Id"].Equals(param1) && d["Name"].Equals(param2))
))
.Return(expectedResult);