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

Creates an instance of the mock.

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

Syntax


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

Parameters

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

Return Value

Mock.

Exceptions


ExceptionCondition
ArgumentExceptiontype must be a class or interface. - type.
ApplicationExceptionType must be a class or interface. - type.
ApplicationExceptionType must be a class or interface., nameof(type)