Example #1
0
        public void BaseBootstrapper_WithBasicSetupOfTestAssembly_RunsWithoutFailing()
        {
            var containerMock = new Mock<IIocContainer>();

            var baseBootstrapper = new BaseBootstrapper(
                containerMock.Object,
                GetType().Assembly);
        }
Example #2
0
        public void BaseBootstrapper_TestAssembly_RunsWithRegisteringMigrationService()
        {
            var containerMock = new Mock<IIocContainer>();

            var baseBootstrapper = new BaseBootstrapper(
                containerMock.Object,
                GetType().Assembly);

            containerMock.Verify(
                x => x.RegisterType(typeof(MigrationService), typeof(IMigrationService)),
                Times.Once());
        }
Example #3
0
        public void BaseBootstrapper_TestAssembly_LoggerRegisteredOnce()
        {
            var containerMock = new Mock<IIocContainer>();

            var baseBootstrapper = new BaseBootstrapper(
                containerMock.Object,
                GetType().Assembly);

            containerMock.Verify(
                x => x.RegisterType(typeof(Logger), typeof(ILogger)),
                Times.Once());
        }
        public void ConfigureServices(IServiceCollection services)
        {
            var mapperConfiguration = new MapperConfiguration(cfg =>
            {
                BaseBootstrapper bootstrapper = new BaseBootstrapper(services, cfg);
            });

            IMapper mapper = mapperConfiguration.CreateMapper();

            services.AddSingleton(mapper);

            services.AddSingleton(appSettings);
            services.AddSingleton <IAppSettings>(appSettings);
            services.AddSingleton <IHttpContextAccessor, HttpContextAccessor>();
            services.AddControllers();
        }