IVerifyCallsHandlerWasNotCalledT Method (FuncT)

Typemock Isolator Developer Guide
Overloaded. Verifies that a method was not called regardless of parameters.

Namespace:  TypeMock.ArrangeActAssert.Fluent
Assembly:  Typemock.ArrangeActAssert (in Typemock.ArrangeActAssert.dll) Version: 9.4.1.0 (9.4.1.0)
Syntax

void WasNotCalled<T>(
	Func<T> func
)

Parameters

func
Type: SystemFuncT
A method returning a value in the form of a Lambda Expression that we want to verify if was called.

Type Parameters

T
Exceptions

ExceptionCondition
VerifyException Thrown if the method, or chain of methods was called at least once.
Remarks

This can also be a chain of methods. In that case, the verification is on the entire chain, and not part of it.
Examples

This example shows how to use Isolate.Verify in order to check a method was not called
[TestMethod]
[Isolated]
public void VerifyMethodWasNotCalled()
{
   RealLogger fake = Isolate.Fake.Instance<RealLogger>();

   fake.Increment();

   // This verification should fail
   Isolate.Verify.WasNotCalled(() => fake.Increment()); 
}
See Also

Reference