New to Telerik JustMock? Download free 30-day trial

Mock Behaviors

This article provides a quick overview of the four mock behaviors in Telerik® JustMock. For more details about each mock behavior, follow the links below.

RecursiveLoose Behavior

This is the default mock behavior. It takes care of members at all times by recursively creating empty stubs for them. Mocks with RecursiveLoose behavior will never return null on any of the mocks in the dependency chain even if none of them are arranged.


Loose Behavior

Unless otherwise arranged, the members of loose mocks act like stubs - they return the default value of their return type - null for reference types and the default value for value types.


CallOriginal Behavior

A mock with behavior CallOriginal will follow the original implementation of the mocked instance.


Strict Behavior

When a strict mock is created, you are only allowed to call arranged methods. Every other call will result in MockException.


See Also

In this article