Beispiel #1
0
 public PollHandler(ISpfProcessor processor,
                    IMessageDispatcher dispatcher,
                    ISpfPollerConfig config,
                    ILogger <PollHandler> log)
 {
     _processor  = processor;
     _dispatcher = dispatcher;
     _config     = config;
     _log        = log;
 }
        public void SetUp()
        {
            _dnsClient         = A.Fake <IDnsClient>();
            _spfRecordsParser  = A.Fake <ISpfRecordsParser>();
            _spfRecordExpander = A.Fake <ISpfRecordExpander>();
            _evaluator         = A.Fake <IEvaluator <SpfPollResult> >();
            _config            = A.Fake <ISpfPollerConfig>();


            _spfProcessor = new SpfProcessor(_dnsClient, _spfRecordsParser, _spfRecordExpander, _evaluator, _config);
        }
 public SpfProcessor(IDnsClient dnsClient,
                     ISpfRecordsParser spfRecordsParser,
                     ISpfRecordExpander spfRecordExpander,
                     IEvaluator <SpfPollResult> pollResultRulesEvaluator,
                     ISpfPollerConfig config)
 {
     _dnsClient                = dnsClient;
     _spfRecordsParser         = spfRecordsParser;
     _spfRecordExpander        = spfRecordExpander;
     _pollResultRulesEvaluator = pollResultRulesEvaluator;
     _config = config;
 }
        public void SetUp()
        {
            _spfTermExpanderStrategy = A.Fake <ISpfTermExpanderStrategy>();

            List <ISpfTermExpanderStrategy> spfTermExpanderStrategies = new List <ISpfTermExpanderStrategy>
            {
                _spfTermExpanderStrategy
            };

            _spfPollerConfig = A.Fake <ISpfPollerConfig>();

            _spfRecordExpander = new SpfRecordExpander(spfTermExpanderStrategies, _spfPollerConfig);
        }
Beispiel #5
0
 public LinuxDnsNameServerProvider(ILogger <LinuxDnsNameServerProvider> log, ISpfPollerConfig config)
 {
     _log    = log;
     _config = config;
 }
 public void SetUp()
 {
     _config = A.Fake <ISpfPollerConfig>();
     A.CallTo(() => _config.MaxDnsQueryCount).Returns(20);
     _rule = new ShouldNotHaveMoreThan10QueryLookups(_config);
 }
 public ShouldNotHaveMoreThan10QueryLookups(ISpfPollerConfig config)
 {
     _config = config;
 }
 public SpfRecordExpander(IEnumerable <ISpfTermExpanderStrategy> strategies,
                          ISpfPollerConfig config)
 {
     _config     = config;
     _strategies = new Lazy <Dictionary <Type, ISpfTermExpanderStrategy> >(() => strategies.ToDictionary(_ => _.TermType));
 }