public CorrelationManagerTests()
        {
            _correlationContextAccessor = new CorrelationContextAccessor();

            _correlationIdFactoryMock = new Mock <ICorrelationIdFactory>();
            _correlationIdFactoryMock
            .Setup(m => m.Create())
            .Returns(() => GeneratedCorrelationId)
            .Verifiable();

            _sut = new CorrelationManager(
                new CorrelationContextFactory(_correlationContextAccessor),
                _correlationIdFactoryMock.Object,
                new TestLogger <CorrelationManager>()
                );
        }
        public CorrelationManagerTests()
        {
            _correlationContextAccessor = new CorrelationContextAccessor();

            _correlationIdFactoryMock = new Mock <ICorrelationIdFactory>();
            _correlationIdFactoryMock
            .Setup(m => m.Create())
            .Returns(() => GeneratedCorrelationId)
            .Verifiable();

            Logger serilogLogger = new LoggerConfiguration()
                                   .WriteTo.TestCorrelator()
                                   .CreateLogger();

            _logProvider = new SerilogLoggerProvider(serilogLogger);
            _logger      = new TestLogger <CorrelationManager>(_logProvider.CreateLogger(nameof(CorrelationManager)));

            _sut = new CorrelationManager(
                new CorrelationContextFactory(_correlationContextAccessor),
                _correlationIdFactoryMock.Object,
                _correlationContextAccessor,
                _logger
                );
        }
예제 #3
0
 public CorrelationContextAccessorTests()
 {
     _sut = new CorrelationContextAccessor();
     _rnd = new Random();
 }