public NinjectModuleTests() { KernelConfigurationMock = new Mock <IKernelConfiguration>(MockBehavior.Strict); SettingsMock = new Mock <INinjectSettings>(MockBehavior.Strict); ComponentsMock = new Mock <IComponentContainer>(MockBehavior.Strict); BindingMock = new Mock <IBinding>(MockBehavior.Strict); NinjectModule = new MyNinjectModule(); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); // внедрение зависимостей NinjectModule recordModule = new MyNinjectModule(); NinjectModule serviceModule = new ServiceModule("EFDbContext"); var kernel = new StandardKernel(recordModule, serviceModule); DependencyResolver.SetResolver(new NinjectDependencyResolver(kernel)); }