Mocker..::..AddMock<(Of <(<'T>)>)> Method (Mock<(Of <(<'T>)>)>, Boolean, Boolean)

Creates a MockModel with the given Mock with the option of overwriting an existing MockModel

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

Syntax


public MockModel<T> AddMock<T>(
	Mock<T> mock,
	bool overwrite,
	bool nonPublic
)
Public Function AddMock(Of T) ( _
	mock As Mock(Of T), _
	overwrite As Boolean, _
	nonPublic As Boolean _
) As MockModel(Of T)
public:
generic<typename T>
MockModel<T>^ AddMock(
	Mock<T>^ mock, 
	bool^ overwrite, 
	bool^ nonPublic
)

Type Parameters

T
The Mock Type, usually an interface.

Parameters

mock
Type: Mock<(Of <(<'T>)>)>
Mock to Add.
overwrite
Type: Boolean
Overwrite if the mock exists or throw ArgumentException if this parameter is false.
nonPublic
Type: Boolean
if set to true uses public and non-public constructors.

Return Value

[T:FastMoq.Models.MockModel<T>].

See Also


AddMock Overload