public void SetUp()
        {
            _mxQueueProcessor        = A.Fake <IMxQueueProcessor>();
            _publisher               = A.Fake <IMessagePublisher>();
            _mxHostTester            = A.Fake <ITlsSecurityTesterAdapator>();
            _mxSecurityTesterConfig  = A.Fake <IMxTesterConfig>();
            _processingFilter        = A.Fake <IMxSecurityProcessingFilter>();
            _recentlyProcessedLedger = A.Fake <IRecentlyProcessedLedger>();
            _log = A.Fake <ILogger <MxSecurityTesterProcessor> >();

            A.CallTo(() => _mxSecurityTesterConfig.PublishBatchSize).Returns(1);
            A.CallTo(() => _mxSecurityTesterConfig.PublishBatchFlushIntervalSeconds).Returns(1);
            A.CallTo(() => _mxSecurityTesterConfig.TlsTesterThreadCount).Returns(1);

            cancellationTokenSource     = new CancellationTokenSource();
            cancellationTokenSourceTask = cancellationTokenSource.Token.WhenCanceled();

            _mxSecurityTesterProcessor = new MxSecurityTesterProcessor(_mxQueueProcessor,
                                                                       _publisher,
                                                                       _mxHostTester,
                                                                       _mxSecurityTesterConfig,
                                                                       _processingFilter,
                                                                       _recentlyProcessedLedger,
                                                                       _log,
                                                                       RunPipelineDelegate);
        }
        public void SetUp()
        {
            _tlsSecurityTesterAdaptor = A.Fake <ITlsSecurityTesterAdapator>();
            _cache  = A.Fake <ICache>();
            _config = A.Fake <IMxSecurityTesterConfig>();

            _cachingTlsSecurityTesterAdaptor = new CachingTlsSecurityTesterAdapator(_tlsSecurityTesterAdaptor,
                                                                                    _cache, _config, A.Fake <ILogger>());
        }
 public CachingTlsSecurityTesterAdapator(ITlsSecurityTesterAdapator tlsSecurityTesterAdaptor,
                                         ICache cache,
                                         IMxSecurityTesterConfig config,
                                         ILogger log)
 {
     _tlsSecurityTesterAdaptor = tlsSecurityTesterAdaptor;
     _cache  = cache;
     _config = config;
     _log    = log;
 }
 public MxSecurityTesterProcessor(
     IMxQueueProcessor mxQueueProcessor,
     IMessagePublisher publisher,
     ITlsSecurityTesterAdapator mxHostTester,
     IMxTesterConfig config,
     IMxSecurityProcessingFilter processingFilter,
     IRecentlyProcessedLedger recentlyProcessedLedger,
     ILogger <MxSecurityTesterProcessor> log) : this(
         mxQueueProcessor,
         publisher,
         mxHostTester,
         config,
         processingFilter,
         recentlyProcessedLedger,
         log,
         null)
 {
 }
 internal MxSecurityTesterProcessor(
     IMxQueueProcessor mxQueueProcessor,
     IMessagePublisher publisher,
     ITlsSecurityTesterAdapator mxHostTester,
     IMxTesterConfig config,
     IMxSecurityProcessingFilter processingFilter,
     IRecentlyProcessedLedger recentlyProcessedLedger,
     ILogger <MxSecurityTesterProcessor> log,
     Func <ITargetBlock <object>, CancellationToken, Task> runPipeline)
 {
     _mxQueueProcessor = mxQueueProcessor;
     _publisher        = publisher;
     _mxHostTester     = mxHostTester;
     _config           = config;
     _log = log;
     _recentlyProcessedLedger  = recentlyProcessedLedger;
     _processingFilter         = processingFilter;
     PublishBatchFlushInterval = TimeSpan.FromSeconds(_config.PublishBatchFlushIntervalSeconds);
     PrintStatsInterval        = TimeSpan.FromSeconds(_config.PrintStatsIntervalSeconds);
     RunPipeline = runPipeline ?? DefaultRunPipeline;
 }