Generic Class

Typemock Isolator Developer Guide
This class helps strongly type generic method types when using Reflective Mocks
Inheritance Hierarchy

System.Object
  TypeMock.Generic

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

public static class Generic
Methods

  NameDescription
Public methodStatic memberMethod<TArg0>()
Define Expectations of Generic Methods with 1 generic parameter
Public methodStatic memberMethod<TArg0, TArg1>()
Define Expectations of Generic Methods with 2 generic parameter
Public methodStatic memberMethod<TArg0, TArg1, TArg2>()
Define Expectations of Generic Methods with 3 generic parameter
Public methodStatic memberMethod<TArg0, TArg1, TArg2, TArg3>()
Define Expectations of Generic Methods with 4 generic parameter
Top
Remarks

Following is an example of using Generic
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

Reference