public void SetDbContext() { _currentConnStr = Environment.GetEnvironmentVariable("CV_19_DB_CONNECTION"); const string connectionString = "Host=localhost;Database=i-need-help-test;Username=postgres;Password=mypassword"; DbContext = new Cv19SupportDbContext(_currentConnStr ?? connectionString); ClearResidentSupportAnnexTable(); if (_currentConnStr == null) { Environment.SetEnvironmentVariable("CV_19_DB_CONNECTION", connectionString); } }
public void SetUp() { _connectionString = Environment.GetEnvironmentVariable("CV_19_DB_CONNECTION"); const string connectionString = "Host=localhost;Database=i-need-help-test;Username=postgres;Password=mypassword"; _context = new Cv19SupportDbContext(_connectionString ?? connectionString); ClearResidentSupportAnnexTable(); ClearDeliveryBatchTable(); ClearDeliveryReportDataTable(); ClearBankHolidays(); if (_connectionString == null) { Environment.SetEnvironmentVariable("CV_19_DB_CONNECTION", connectionString); } _classUnderTest = new INeedHelpGateway(_context); }
public INeedHelpGateway(Cv19SupportDbContext context) { _dbContext = context; }
public OrganisationVolunteerGateway(string connectionString) { _connectionString = connectionString; _dbContext = new Cv19SupportDbContext(_connectionString); }