public void AddBinaryNull_Should_NotAddLogEventDetail() { var logEvent = new LogEvent <StandardLoglevel>(_ => { }, StandardLoglevel.Warning); BinaryExtensions.Binary <StandardLoglevel>(logEvent, null).Should().BeSameAs(logEvent); logEvent.Details.OfType <Binary>().Any().Should().BeFalse(); }
public void AddBinaryData_Should_AddLogEventDetail() { var data = new byte[] { 48, 49, 50, 51 }; var logEvent = new LogEvent <StandardLoglevel>(_ => { }, StandardLoglevel.Warning); BinaryExtensions.Binary <StandardLoglevel>(logEvent, data).Should().BeSameAs(logEvent); logEvent.Details.OfType <Binary>().Single().Data.SequenceEqual(data).Should().BeTrue(); }
public void LogEventNull_ShouldThrow_ArgumentNullException() { Assert.Throws <ArgumentNullException>(() => BinaryExtensions.Binary <StandardLoglevel>(null, new byte[] { 0x00, 0x01, 0x02, 0x03 })); }