문제

I am using VS2012 Fakes and MSTEST framework to do unit test. I have a third party dll and I need to fake it. However there is a method (getItemAt(int)) in the dll that seems to conflict with a method that exits in Fakes.

The error message I get during compile is:

Error 2 The type 'MyObject.Fakes.ShimList' already contains a definition for 'get_ItemAtInt32' [D:\Dev\Test\obj\Debug\Fakes\o\f.csproj] D:\Dev\Teste\f.cs 6933 111 Test

Any solution to pass by this error to continue work with Fakes?

도움이 되었습니까?

해결책

It appears that the Fakes code generator breaks when trying to generate a shim for MyObject.List class in this third-party library. Could you submit this at http://connect.microsoft.com/VisualStudio? In the meantime, you can use the approach described here to generate only those stubs and shims you actually plan to use. Hopefully, that does not include the MyObject.List class.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top