#35 Mocking Generic method causes TypeLoad exception

open
nobody
Mocks (4)
5
2009-06-24
2009-06-24
Anonymous
No

RC2 doesn't work for mocking generics. It complains of a TypeLoad exception.
RC1 works fine.

Discussion

  • I've run into problems with this bug as well. An interface with generic methods (when the interface itself is not generic) cause a problem:

    interface Foo {
    void Bar<T>()
    }

    Trying to mock this interface causes this ugly exception message:

    System.TypeLoadException: Signature of the body and declaration in a method implementation do not match. Type: 'MockObjectType1'. Assembly: 'MockObjects, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null