示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        public void Exceptions_GetEventId_SnException()
        {
            var eventId = SnLog.GetEventId(new MyCustomException("MSG"));

            Assert.AreEqual(MyCustomException.MyCustomEventId, eventId);
        }