예제 #1
0
        public void ExceptionFingerprintIsPresent()
        {
            Exception ex = new ApplicationException("test 1");

            var fingerprint = ConvertException.ToFingerprint(ex);

            AssertIsHash(fingerprint);
        }
예제 #2
0
        public void NullExceptionFingerprintIsEmpty()
        {
            Exception ex = null;

            var fingerprint = ConvertException.ToFingerprint(ex);

            Assert.That(fingerprint, Is.Empty);
        }
 protected override void Append(StringBuilder builder, LogEventInfo logEvent)
 {
     if (logEvent.Exception != null)
     {
         var text = ConvertException.ToFingerprint(logEvent.Exception);
         builder.Append(text);
     }
     else
     {
         base.Append(builder, logEvent);
     }
 }
예제 #4
0
        public void IdenticalExceptionsFromDifferentLinesInAMethodHaveADifferentFingerprint()
        {
            Exception ex1 = PutStackTraceOnExceptionGeneric(new ApplicationException("test 1"), false, "Do stuff");
            Exception ex2 = PutStackTraceOnExceptionGeneric(new ApplicationException("test 1"), true, "Do stuff");

            var fingerprint1 = ConvertException.ToFingerprint(ex1);
            var fingerprint2 = ConvertException.ToFingerprint(ex2);

            AssertIsHash(fingerprint1);
            AssertIsHash(fingerprint2);
            Assert.That(fingerprint1, Is.Not.EqualTo(fingerprint2));
        }
예제 #5
0
        public void IdenticalStacktraceExceptionsHaveSameFingerprint()
        {
            Exception ex1 = PutStackTraceOnException(new ApplicationException("test 1"));
            Exception ex2 = PutStackTraceOnException(new ApplicationException("test 1"));

            var fingerprint1 = ConvertException.ToFingerprint(ex1);
            var fingerprint2 = ConvertException.ToFingerprint(ex2);

            AssertIsHash(fingerprint1);
            AssertIsHash(fingerprint2);
            Assert.That(fingerprint1, Is.EqualTo(fingerprint2));
        }
예제 #6
0
        public void StackTraceIsUsedWhenPresent()
        {
            Exception ex1 = new ApplicationException("test 1");
            Exception ex2 = PutStackTraceOnException(new ApplicationException("test 1"));

            var fingerprint1 = ConvertException.ToFingerprint(ex1);
            var fingerprint2 = ConvertException.ToFingerprint(ex2);

            AssertIsHash(fingerprint1);
            AssertIsHash(fingerprint2);
            Assert.That(fingerprint1, Is.Not.EqualTo(fingerprint2));
        }
예제 #7
0
        public void DifferentMessageExceptionsHaveDifferentFingerprint()
        {
            Exception ex1 = new ApplicationException("test 1");
            Exception ex2 = new ApplicationException("test 2");

            var fingerprint1 = ConvertException.ToFingerprint(ex1);
            var fingerprint2 = ConvertException.ToFingerprint(ex2);

            AssertIsHash(fingerprint1);
            AssertIsHash(fingerprint2);
            Assert.That(fingerprint1, Is.Not.EqualTo(fingerprint2));
        }
예제 #8
0
        public void IdenticalMessageExceptionsHaveSameFingerprint()
        {
            Exception ex1 = new ApplicationException("test 1");
            Exception ex2 = new ApplicationException("test 1");

            var fingerprint1 = ConvertException.ToFingerprint(ex1);
            var fingerprint2 = ConvertException.ToFingerprint(ex2);

            AssertIsHash(fingerprint1);
            AssertIsHash(fingerprint2);
            Assert.That(fingerprint1, Is.EqualTo(fingerprint2));
        }