MockBehavior Enumeration

Moq 2.6

Options to customize the behavior of the mock.

Namespace:  Moq
Assembly:  Moq (in Moq.dll) Version: 2.6.1014.1 (2.6.0.0)

Syntax

C#
public enum MockBehavior

Members

Member nameDescription
Strict
Causes the mock to always throw an exception for invocations that don't have a corresponding expectation.
Loose
Will never throw exceptions, returning default values when necessary (null for reference types, zero for value types or empty enumerables and arrays).
Default
Default mock behavior, which equals Loose.

See Also