CreateMock(T) Method

Moq

Collapse imageExpand ImageCopy imageCopyHover image
Implements creation of a new mock within the factory.

Namespace: Moq
Assembly: Moq (in Moq.dll) Version: 4.0.10827.0 (4.0.0.0)

Syntax

C#
protected virtual Mock<T> CreateMock<T>(
	MockBehavior behavior,
	Object[] args
)
where T : class

Parameters

behavior
Type: Moq..::..MockBehavior
The behavior for the new mock.
args
Type: array<System..::..Object>[]()[][]
Optional arguments for the construction of the mock.

Type Parameters

T
Type to mock.

See Also