Esempio n. 1
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            ApplicationMapper.Initialize();
        }
Esempio n. 2
0
        public void BeforeScenario()
        {
            this.objectContainer.RegisterTypeAs <SpecFlowLogger, ILogger>();
            var logger = this.objectContainer.Resolve <ILogger>();

            var settings = Settings.FromConfiguration();

            this.objectContainer.RegisterInstanceAs <ISettings>(settings);

            ApplicationFactory applicationFactory
                = ApplicationFactory.Get(logger, settings.ProviderType);

            this.objectContainer.RegisterInstanceAs(applicationFactory);

            var applicationMapper = new ApplicationMapper();

            applicationMapper.Initialize(applicationFactory.BaseType);
            this.objectContainer.RegisterInstanceAs <IApplicationMapper>(applicationMapper);

            var windowMapper = new WindowMapper();

            windowMapper.Initialize(applicationFactory.BaseWindowType);
            this.objectContainer.RegisterInstanceAs <IWindowMapper>(windowMapper);

            this.objectContainer.RegisterTypeAs <Context.Context, IContext>();
            this.objectContainer.RegisterTypeAs <TokenManager, ITokenManager>();

            var repository = new ActionRepository(this.objectContainer, settings);

            this.objectContainer.RegisterInstanceAs <IActionRepository>(repository);

            this.objectContainer.RegisterTypeAs <ActionPipelineService, IActionPipelineService>();

            // Initialize the repository
            repository.Initialize();
        }