IMethodSettingsIsStrict Property

Typemock Isolator Developer Guide
Can set one method of the mock to be Strict

Namespace:  TypeMock
Assembly:  TypeMock (in TypeMock.dll) Version: 9.3.6.0 (9.3.6.0)
Syntax

bool IsStrict { get; set; }

Property Value

Type: Boolean
Remarks

By default Mocked Types are NOT strict this mean that if a call to a mocked method was not expected the normal code is executed. Mocked Types can be made strict and fail if an unexpected call is made
Examples

[Test]
public void Test()
{
    // Start mocking TestedClass
    Mock mock = MockManager.Mock(typeof(TestedClass));
    TestedClass t = new TestedClass();
    // No expectations, the following will fail because passInt() is 
    // set to Strict
    mock.MethodSettings("passInt").IsStrict = true;
    t.passInt(10);
    MockManager.Verify();
}
See Also

Reference