public void SetUp() { _logger = A.Fake <ILogger>(); _dnsRecordDao = A.Fake <IDnsRecordDao>(); _dnsRecordUpdater = A.Fake <IDnsRecordUpdater>(); _spfRecordImporterConfig = A.Fake <IRecordImporterConfig>(); _dnsRecordProcessor = new DnsRecordProcessor(_dnsRecordDao, _dnsRecordUpdater, _spfRecordImporterConfig, _logger); }
protected override void SetUp() { base.SetUp(); _connectionInfoAsync = A.Fake <IConnectionInfoAsync>(); _recordImporterConfig = A.Fake <IRecordImporterConfig>(); _dmarcRecordDao = new DmarcRecordDao(_connectionInfoAsync, _recordImporterConfig, A.Fake <ILogger>()); A.CallTo(() => _connectionInfoAsync.GetConnectionStringAsync()).Returns(Task.FromResult(ConnectionString)); }
public DmarcRecordDao(IConnectionInfoAsync connectionInfo, IRecordImporterConfig recordImporterConfig, ILogger log) : base(connectionInfo, recordImporterConfig, log, DmarcRecordDaoResources.SelectDomainsWithRecords, DmarcRecordDaoResources.InsertRecord, DmarcRecordDaoResources.InsertRecordValueFormatString, DmarcRecordDaoResources.InsertRecordOnDuplicateKey) { }
protected DnsRecordDao(IConnectionInfoAsync connectionInfoAsync, IRecordImporterConfig recordImporterConfig, ILogger log, string selectDomainsWithRecords, string insertRecord, string insertRecordValueFormatString, string insertRecordOnDuplicateKey) { _connectionInfoAsync = connectionInfoAsync; _recordImporterConfig = recordImporterConfig; _log = log; _selectDomainsWithRecords = selectDomainsWithRecords; _insertRecord = insertRecord; _insertRecordValueFormatString = insertRecordValueFormatString; _insertRecordOnDuplicateKey = insertRecordOnDuplicateKey; }
public DnsRecordProcessor(IDnsRecordDao dnsRecordDao, IDnsRecordUpdater dnsRecordUpdater, IRecordImporterConfig recordImporterConfig, ILogger log) { _dnsRecordDao = dnsRecordDao; _dnsRecordUpdater = dnsRecordUpdater; _recordImporterConfig = recordImporterConfig; _log = log; _log.Debug($"DnsRecordProcessor created with following parameters: {Environment.NewLine}" + $"\tDnsRecordLimit: {_recordImporterConfig.DnsRecordLimit}{Environment.NewLine}" + $"\tRefreshIntervalSeconds: {_recordImporterConfig.RefreshIntervalSeconds}{Environment.NewLine}" + $"\tFailureRefreshIntervalSeconds: {_recordImporterConfig.FailureRefreshIntervalSeconds}{Environment.NewLine}" + $"\tRemainingTimeTheshold: {_recordImporterConfig.RemainingTimeTheshold}"); }
private void SetConfig(IRecordImporterConfig config, int refreshIntervalSeconds, int failureRefreshIntervalSeconds, int dnsRecordLimit) { A.CallTo(() => config.RefreshIntervalSeconds).Returns(refreshIntervalSeconds); A.CallTo(() => config.FailureRefreshIntervalSeconds).Returns(failureRefreshIntervalSeconds); A.CallTo(() => config.DnsRecordLimit).Returns(dnsRecordLimit); }