Mocker..::..CreateMock Method (Type, Boolean, array<Object>[]()[][])

Creates the MockModel from the Type. This throws an exception if the mock already exists.

Namespace:  FastMoq
Assembly:  FastMoq.Core (in FastMoq.Core.dll)

Syntax


public List<MockModel> CreateMock(
	Type type,
	bool nonPublic,
	params Object[] args
)
Public Function CreateMock ( _
	type As Type, _
	nonPublic As Boolean, _
	ParamArray args As Object() _
) As List(Of MockModel)
public:
List<MockModel^>^ CreateMock(
	Type^ type, 
	bool^ nonPublic, 
	... array<Object^>^ args
)

Parameters

type
Type: Type
The type.
nonPublic
Type: Boolean
true if non-public and public constructors are used.
args
Type: array<Object>[]()[][]
The arguments used to match to the constructor.

Return Value

List<T>.

Exceptions


ExceptionCondition
ArgumentExceptiontype must be a class. - type
ApplicationExceptionCannot create instance.