public void ExceptionFingerprintIsPresent() { Exception ex = new ApplicationException("test 1"); var fingerprint = ConvertException.ToFingerprint(ex); AssertIsHash(fingerprint); }
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); } }
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)); }
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)); }
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)); }
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)); }
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)); }