public void Given_Message_Warning_ShouldLog_Warning(LogEventLevel logLevel, string message) { var logger = this._fixture.ArrangeLogger(logLevel, out TestSink sink); LoggerExtensions.Warning(logger, message); sink.LogItems.Count.Should().Be(1); var log = sink.LogItems.Single(); log.Level.Should().Be(logLevel); log.MessageTemplate.Text.Should().BeEquivalentTo(message); }
public void Given_NullParameter_Warning_ShouldThrow_Exception() { Action action = () => LoggerExtensions.Warning(null, null); action.ShouldThrow <ArgumentNullException>(); }