Typemock Isolator can validates parameter values, collections and arrays.
To do so just pass the list of expected parameter values to the Args
method.
Namespace: TypeMock
Assembly: TypeMock (in TypeMock.dll) Version: 9.3.6.0 (9.3.6.0)
Syntax
The IParameters type exposes the following members.
Methods
Name | Description | |
---|---|---|
![]() | Args | |
![]() | When |
Remarks
Examples
[Test] public void Test() { // Start mocking TestedClass Mock mock = MockManager.Mock(typeof(TestedClass)); // first time passInt will be called, arguments must be 10 mock.ExpectCall("passInt").Args(10); // second time 1 mock.ExpectCall("passInt").Args(1); TestedClass t = new TestedClass(); // This will pass t.passInt(10); // This will fail t.passInt(3); MockManager.Verify(); }
![]() |
---|
BEWARE, Typemock Isolator normally check the type of return value with the existing method, but it does not check the legitimacy of the returned value in case of overloaded methods that have different return types, (as Typemock Isolator sees these as one mocked method) if you return a value with the wrong type a System.InvalidCastException will be thrown |
![]() |
---|
Typemock Isolator supports checking methods with up to 30 parameters |
![]() |
---|
This Interface is not to be implemented by client |
See Also