StubAll(T) Method

Moq 2.6

Stubs all properties on the mock, setting the default value to the one generated as specified by the DefaultValue property.

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

Syntax

C#
public static void StubAll<T>(
	Mock<T> mock
)
where T : class

Parameters

mock
Type: Moq..::.Mock<(Of <(T>)>)
The mock to stub.

Type Parameters

T
Mocked type, typically omitted as it can be inferred from the mock argument.

Remarks

If the mock DefaultValue is set to Mock, the mocked default values will also be stubbed recursively.

See Also