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.

Read more...

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.

Read more...

CallOriginal Behavior

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

Read more...

Strict Behavior

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

Read more...

See Also

In this article