New to Telerik JustMock? Start a free 30-day trial
Loose
Updated on Jan 29, 2026
Loose mocks will create stubs for all void methods of the mocked type. For all value type members, the mock will return its default value and for all reference type members - null. For collection return types (e.g. array or IEnumerable) a non-null empty collection will be returned, instead of null.
To reach deeper-level functions, you will need to arrange them first. Loose mocks are the predecessors of the RecursiveLoose behavior, which makes them rarely used nowadays.
Syntax
Mock.Create<T>(Behavior.Loose);
Examples
To see the difference between RecursiveLoose and Loose Behavior, check this example.