작업을 갖는 실행 단위 테스트는 새로운 StandardKernel에서 런타임 예외를 불안정하게 만들 수 있습니다.
-
14-11-2019 - |
문제
싱글 톤 클래스에서 먼저 DB 설정을로드하는 장치 테스트에서는 다음과 같습니다.
IKernel kernel = new StandardKernel(new OurInfrastructureNinjectModule());
_myService = kernel.Get<MyService>(); // To inject a concrete to myService
.
MVC 응용 프로그램에서는 잘 실행되지만, 단위 테스트에서 호출 할 때 예외가 던져
해결책
Note: I work at Typemock
Due to changes in security in .NET 4, there was a bug in Typemock Isolator where code running from assemblies marked with AllowPartiallyTrustedCallers
(APTCA) or SecurityTransparent
attributes would crash with this exception. Ninject, seems like it, is marked with such an attribute.
We had fixed this issue in the latest version, so please download it at http://www.typemock.com.
If your issue persists in the latest version (6.0.9 currently), please contact us via support at typemock.com
제휴하지 않습니다 StackOverflow