This class helps strongly type generic method types when using Reflective Mocks
Inheritance Hierarchy
TypeMockGeneric
Namespace: TypeMock
Assembly: TypeMock (in TypeMock.dll) Version: 9.3.6.0 (9.3.6.0)
Syntax
Methods
Name | Description | |
---|---|---|
![]() ![]() | MethodTArg0 |
Define Expectations of Generic Methods with 1 generic parameter
|
![]() ![]() | MethodTArg0, TArg1 |
Define Expectations of Generic Methods with 2 generic parameter
|
![]() ![]() | MethodTArg0, TArg1, TArg2 |
Define Expectations of Generic Methods with 3 generic parameter
|
![]() ![]() | MethodTArg0, TArg1, TArg2, TArg3 |
Define Expectations of Generic Methods with 4 generic parameter
|
Remarks
Examples
VB
<Test()> _ Public Sub MockGenericMethod() Dim mock As Mock = Mock(Of MockedClass).MockNextInstance() mock.AlwaysReturn("Method", 11, Generic.Method(Of Integer)()); Assert.AreEqual(11, test.Method(Of Integer)(1)); End Sub
[Test] public void MockGenericMethod() { Mock mock = Mock<MockedClass>.MockNextInstance(); mock.AlwaysReturn("Method", 11, Generic.Method<int>()); MockedClass test = new MockedClass(); Assert.AreEqual(11, test.Method<int>(1)); }
See Also