public AccountsDbContextTests()
        {
            GenFuConfigurator.Initialise();

            var services = new ServiceCollection();

            services.AddOptions();
            services.AddLogging();
            services.AddAutoMapper(cfg =>
            {
                //cfg.AddProfile<AssureCoreDataAccessLayerAutoMapperProfile>();
            });

            services.AddDataAccessLayer();

            _serviceProvider = services.BuildServiceProvider();

            //configure NLog
            _loggerFactory = _serviceProvider.GetRequiredService <ILoggerFactory>();
            _loggerFactory.AddNLog();
            NLog.LogManager.LoadConfiguration("nlog.config");

            _mapper = _serviceProvider.GetService <IMapper>();

            _logger    = _loggerFactory.CreateLogger <AccountsDbContextTests>();
            _dbContext = _serviceProvider.GetService <IAccountsDbContext>();
        }
Example #2
0
        public AccountsRepository(ILogger <AccountsRepository> logger, IObjectDocumentSerializer objectDocumentSerializer, IAccountsDbContext dbContext)
        {
            this._logger = logger;

            this._dbContext = dbContext;
            this._objectDocumentSerializer = objectDocumentSerializer;
        }