La prueba de la unidad de ejecución que tiene operación podría desestabilizar la excepción de tiempo de ejecución en New StandardKernel
-
14-11-2019 - |
Pregunta
En nuestras pruebas unitarias, donde primero carga la configuración de DB de una clase de Singleton, tenemos:
IKernel kernel = new StandardKernel(new OurInfrastructureNinjectModule());
_myService = kernel.Get<MyService>(); // To inject a concrete to myService
Se ejecuta bien en nuestra aplicación MVC, sin embargo, la excepción lanzó cuando se llama a prueba de unidad.
Solución
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