MockExpectAndReturn Method (String, Object, Int32, Type)

Typemock Isolator Developer Guide
Expect a number of calls from method, and mock return value

Namespace:  TypeMock
Assembly:  TypeMock (in TypeMock.dll) Version: 9.4.1.0 (9.4.1.0)
Syntax

public IParameters ExpectAndReturn(
	string method,
	Object ret,
	int timesToRun,
	params Type[] genericTypes
)

Parameters

method
Type: SystemString
Method Name
ret
Type: SystemObject
Mocked return value
timesToRun
Type: SystemInt32
Number of times to expect the call
genericTypes
Type: SystemType
List of generic types, to mock bounded generic methods

Return Value

Type: IParameters
Can Check Parameters, see IParameters

Implements

IMockControlExpectAndReturn(String, Object, Int32, Type)
Exceptions

ExceptionCondition
TypeMockExceptionIf method is not found or doesn't return the return value type
See Also

Reference