Пример #1
0
 public Guide(IConnection connection, ICommandHandler commandHandler, ServicesBootstrapper servicesBootstrapper, HelperRoleHandler helperRoleHandler)
 {
     this.connection           = connection;
     this.commandHandler       = commandHandler;
     this.servicesBootstrapper = servicesBootstrapper;
     this.helperRoleHandler    = helperRoleHandler;
 }
Пример #2
0
        public void Register_WithContainer_RegistersClock()
        {
            var bootstrapper = new ServicesBootstrapper();
            var container    = ContainerFactory.Bootstrap <EmptyServicesBootstrapper>();

            bootstrapper.Bootstrap(container);

            Assert.That(container.Resolve <IClock>(), Is.Not.Null);
        }
Пример #3
0
 public static void Register(IMutableDependencyResolver services, IReadonlyDependencyResolver resolver,
                             DataAccessConfiguration dataAccessConfig)
 {
     EnvironmentServicesBootstrapper.RegisterEnvironmentServices(services, resolver);
     ConfigurationBootstrapper.RegisterConfiguration(services, resolver, dataAccessConfig);
     LoggingBootstrapper.RegisterLogging(services, resolver);
     AvaloniaServicesBootstrapper.RegisterAvaloniaServices(services);
     FileSystemWatcherServicesBootstrapper.RegisterFileSystemWatcherServices(services, resolver);
     DataAccessBootstrapper.RegisterDataAccess(services, resolver);
     ServicesBootstrapper.RegisterServices(services, resolver);
     ViewModelsBootstrapper.RegisterViewModels(services, resolver);
 }
Пример #4
0
        public ApiBootstrapper(string functionName)
        {
            DependencyInjection.Initialize(builder =>
            {
                RegisterLogging(builder);

                var dbConfig = GetDatabaseConfig(builder);
                builder.RegisterInstance(dbConfig);

                //var someSetting = GetSomeSetting();
                //builder.RegisterInstance(someSetting);


                ServicesBootstrapper.Register(builder, dbConfig);
            }, functionName);
        }
Пример #5
0
 private void RegisterServices(IServiceCollection services)
 {
     ServicesBootstrapper.RegisterServices(services, Configuration);
 }
Пример #6
0
        public void Register_NullContainer_ThrowsArgumentNullException()
        {
            var bootstrapper = new ServicesBootstrapper();

            Assert.Throws <ArgumentNullException>(() => bootstrapper.Bootstrap(null));
        }