I'm wondering if it's possible to pass in my own arguments to a custom argument checker in addition to the ParameterCheckerEventArgs? I apologize if this is a C# question and not a TypeMock question, I'm relatively new to C# as well.
I want to do something like this for my custom checker:
private static bool ArraySizeIs(int expectedArraySize, ParameterCheckerEventArgs args)
{
MyCollectionType paramToCheck = (MyCollectionType)args.ArgumentValue;
return paramToCheck.Count == expectedArraySize;
}
But then how would I call it in recorder.CheckArguments? Not like this:
using (RecordExpectations recorder = RecorderManager.StartRecording())
{
MyDal dal = new MyDal();
dal.Delete(null);
recorder.Return(results);
recorder.CheckArguments(new ParameterCheckerEx(ArraySizeIs(2000)));
}
________
HIACE