Mocker..::..CreateMock<(Of <(<'T>)>)> Method (Boolean, array<Object>[]()[][])

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

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

Syntax


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

Type Parameters

T
The Mock Type, usually an interface.

Parameters

nonPublic
Type: Boolean
if set to true public and non-public constructors are used.
args
Type: array<Object>[]()[][]
The arguments used to find the correct constructor for a class.

Return Value

List<T>.

Exceptions


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