Skip to content

Commit da6b036

Browse files
author
Josh DeGraw
committed
Fixed failing test
1 parent 8d5ce56 commit da6b036

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/Sentry.NLog/SentryTarget.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ protected override void Write(LogEventInfo logEvent)
188188
// If this is true, an exception is being logged with no custom message
189189
if (exception != null && !message.StartsWith(exception.Message))
190190
{
191-
// Exception.Message won't be used as Breadcrumb message Avoid losing it by adding as data:
191+
// Exception won't be used as Breadcrumb message. Avoid losing it by adding as data:
192192
data = new Dictionary<string, string>
193193
{
194194
{ "exception_type", exception.GetType().ToString() },

test/Sentry.NLog.Tests/SentryTargetTests.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public void Log_WithException_CreatesEventWithException()
154154
}
155155

156156
[Fact]
157-
public void Log_WithException_BreadcrumbFromException()
157+
public void Log_WithOnlyException_GeneratesBreadcrumbFromException()
158158
{
159159
var expectedException = new Exception("expected message");
160160

@@ -171,7 +171,9 @@ public void Log_WithException_BreadcrumbFromException()
171171
Assert.Null(b.Category);
172172
Assert.Equal(b.Level, expectedLevel);
173173
Assert.Null(b.Type);
174-
Assert.Null(b.Data);
174+
Assert.NotNull(b.Data);
175+
Assert.Equal(expectedException.GetType().ToString(), b.Data["exception_type"]);
176+
Assert.Equal(expectedException.Message, b.Data["exception_message"]);
175177
}
176178

177179
[Fact]

0 commit comments

Comments
 (0)