Hi,
We have added this to version 2.2.1 that also contains a bug fix.
Here is an example of how to use CustomChecker
// C#
public static bool CheckParameter(ParameterCheckerEventArgs data)
{
return data.ArgumentValue == data.ExpectedValue;
}
[Test]
public void CheckParameters()
{
MockManager.Init();
Mock mock = MockManager.Mock(typeof(TestedClass));
TestedClass t = new TestedClass();
// setup expectation, test first argument by calling our CheckParameter
// with ExpectedValue set
mock.ExpectCall("SomeMethod").Args(
Check.CustomChecker(
new ParameterCheckerEx(CheckParameter),"String")));
t.SomeMethod("String","Another");
MockManager.Verify();
}
' Visual Basic
Public Shared Function CheckParameter(ByVal data As
ParameterCheckerEventArgs) As Boolean
CheckParameter = data.ArgumentValue = data.ExpectedValue;
End Function
<Test()> _
Public Sub CheckParameters()
MockManager.Init()
Dim mock As Mock MockManager.Mock(GetType(TestedClass))
Dim t As TestedClass = New TestedClass
' setup expectation, test first argument by calling our CheckParameter
' with ExpectedValue set
mock.ExpectCall("SomeMethod").Args(
Check.CustomChecker(
New ParameterCheckerEx(AddressOf CheckParameter),"String"))
t.SomeMethod("String","Another")
MockManager.Verify()
End Sub
Documentation will be ready for the next release
[/code]