Exemple #1
0
        protected DnsRecordImporter(string recordType, Func <ILogger, IDnsRecordProcessor> recordProcessorFactory)
        {
            _recordType = recordType;
            Stopwatch stopwatch = Stopwatch.StartNew();

            _log = new LambdaLoggerAdaptor();

            _dnsRecordProcessor = recordProcessorFactory(_log);

            _log.Debug($"Creating {recordType}RecordImporter took: {stopwatch.Elapsed}");
            stopwatch.Stop();
        }
        public void SpfRecordProcessorCorrectedCreated()
        {
            Environment.SetEnvironmentVariable("DnsRecordLimit", "50");
            Environment.SetEnvironmentVariable("AWS_ACCESS_KEY_ID", "50");
            Environment.SetEnvironmentVariable("AWS_SECRET_ACCESS_KEY", "50");
            Environment.SetEnvironmentVariable("AWS_SESSION_TOKEN", "50");
            Environment.SetEnvironmentVariable("RefreshIntervalSeconds", "50");
            Environment.SetEnvironmentVariable("FailureRefreshIntervalSeconds", "50");
            Environment.SetEnvironmentVariable("RemainingTimeThresholdSeconds", "50");
            Environment.SetEnvironmentVariable("SnsTopicArn", "http://test.topic");
            Environment.SetEnvironmentVariable("ConnectionString", "ConnectionString");

            IDnsRecordProcessor recordProcessor = SpfRecordProcessorFactory.Create(A.Fake <ILogger>());

            Assert.That(recordProcessor, Is.Not.Null);
        }