Example #1
0
        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();
        }
Example #2
0
        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));
        }