Ejemplo n.º 1
0
        public void DoEvenMoreLogsCorrectParameters()
        {
            // Arrange
            var loggerFactory = TestLoggerFactory.Create();
            var sampleLogger  = loggerFactory.CreateLogger <Sample>();
            var moreLogger    = loggerFactory.CreateLogger <More>();
            var more          = new More(new Sample(sampleLogger), moreLogger);


            // Act
            more.DoEvenMore();

            // Assert
            var log = Assert.Single(loggerFactory.Sink.LogEntries);

            // Assert specific parameters in the log entry
            LoggingAssert.Contains("number", 42, log.Properties);
            LoggingAssert.Contains("foo", "bar", log.Properties);
        }