public void Exceptions_GetEventId_SnException_Deep() { // find event id in inner exception var deepException = new Exception("MSG1", new Exception("MSG2", new MyCustomException("MSG3"))); var eventId = SnLog.GetEventId(deepException); Assert.AreEqual(MyCustomException.MyCustomEventId, eventId); }
public void Exceptions_GetEventId_Data() { // find event id in custom data of a simple exception const int externalEventId = 12345; var deepException = new Exception("MSG1", new Exception("MSG2", new Exception("MSG3") { Data = { { "EventId", externalEventId } } })); var eventId = SnLog.GetEventId(deepException); Assert.AreEqual(externalEventId, eventId); }
public void Exceptions_GetEventId_SnException() { var eventId = SnLog.GetEventId(new MyCustomException("MSG")); Assert.AreEqual(MyCustomException.MyCustomEventId, eventId); }