コード例 #1
0
        public async Task CoreLogger_Should_LogDebug()
        {
            // Arrange
            bool wasLogExecuted = false;
            var  helpers        = GetHelpers();

            helpers.LoggerStub
            .Setup(l => l.Log(LogLevel.Debug, It.IsAny <EventId>(), It.IsAny <object>(), It.IsAny <Exception>(), It.IsAny <Func <object, Exception, string> >()))
            .Callback(() => wasLogExecuted = true);

            var coreLogger = new CoreLogger(helpers.LoggerStub.Object);

            // Act
            await coreLogger.LogDebugAsync(helpers.Correlation, "Testing loggers", helpers.Causation);

            // Assert
            wasLogExecuted.Should().BeTrue();
        }