public void ignore_null_properties_in_the_exception_output() { try { var exception = new ExceptionWithProperty2() { UserId = 10 }; var sut = new BaseLoggerWrapper(GetType()); var actual = sut.FormatException(exception); Assert.AreEqual(actual.StartsWith(" MicroServer.Tests.Logging.Loggers.ExceptionWithProperty2"), true); Assert.AreEqual(actual.EndsWith("[UserId='10']\r\n"), true); } catch (Exception ex) { Assert.IsTrue(ex is Exception); } }
public void include_properties_in_the_exception_output() { try { var exception = new ExceptionWithProperty2() { UserId = 10, FirstName = "Arne" }; var sut = new BaseLoggerWrapper(GetType()); var actual = sut.FormatException(exception); Debug.WriteLine(actual.ToString()); Assert.AreEqual(actual.StartsWith(" MicroServer.Tests.Logging.Loggers.ExceptionWithProperty2"), true); Assert.AreEqual(actual.EndsWith("[UserId='10',FirstName='Arne']\r\n"), true); } catch (Exception ex) { Assert.IsTrue(ex is Exception); } }