Mocker..::..AddType Method (Type, Type, Func<(Of <(<'Mocker, Object>)>)>, Boolean, array<Object>[]()[][])

Adds an interface to Class mapping to the typeMap for easier resolution.

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

Syntax


public void AddType(
	Type tInterface,
	Type tClass,
	Func<Mocker, Object> createFunc,
	bool replace,
	params Object[] args
)
Public Sub AddType ( _
	tInterface As Type, _
	tClass As Type, _
	createFunc As Func(Of Mocker, Object), _
	replace As Boolean, _
	ParamArray args As Object() _
)
public:
void AddType(
	Type^ tInterface, 
	Type^ tClass, 
	Func<Mocker^, Object^>^ createFunc, 
	bool^ replace, 
	... array<Object^>^ args
)

Parameters

tInterface
Type: Type
The interface or class Type which can be mapped to a specific Class.
tClass
Type: Type
The Class Type (cannot be an interface) that can be created and assigned to tInterface.
createFunc
Type: Func<(Of <(<'Mocker, Object>)>)>
An optional create function used to create the class.
replace
Type: Boolean
Replace type if already exists. Default: false.
args
Type: array<Object>[]()[][]
arguments needed in model.

Exceptions


ExceptionCondition
ArgumentException