-
-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6b9d321
commit aaa707b
Showing
26 changed files
with
165 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using Sentry.PlatformAbstractions; | ||
|
||
namespace Sentry.Tests.Internals; | ||
|
||
public class AgggregateExceptionTests | ||
{ | ||
private static readonly string DefaultAggregateExceptionMessage = new AggregateException().Message; | ||
|
||
[Fact] | ||
public void AggregateException_GetRawMessage_Empty() | ||
{ | ||
var exception = new AggregateException(); | ||
|
||
var rawMessage = exception.GetRawMessage(); | ||
|
||
Assert.Equal(DefaultAggregateExceptionMessage, rawMessage); | ||
} | ||
|
||
[Fact] | ||
public void AggregateException_GetRawMessage_WithInnerExceptions() | ||
{ | ||
var exception = GetTestAggregateException(); | ||
|
||
var rawMessage = exception.GetRawMessage(); | ||
|
||
Assert.Equal(DefaultAggregateExceptionMessage, rawMessage); | ||
} | ||
|
||
[SkippableFact] | ||
public void AggregateException_GetRawMessage_DiffersFromMessage() | ||
{ | ||
// Sanity check: The message should be different than the raw message, except on full .NET Framework. | ||
// .NET, .NET Core, and Mono all override the Message property to append messages from the inner exceptions. | ||
// .NET Framework does not. | ||
|
||
Skip.If(RuntimeInfo.GetRuntime().IsNetFx()); | ||
|
||
var exception = GetTestAggregateException(); | ||
|
||
var rawMessage = exception.GetRawMessage(); | ||
|
||
Assert.NotEqual(exception.Message, rawMessage); | ||
} | ||
|
||
private static AggregateException GetTestAggregateException() => | ||
Assert.Throws<AggregateException>(() => | ||
{ | ||
var t1 = Task.Run(() => throw new Exception("Test 1")); | ||
var t2 = Task.Run(() => throw new Exception("Test 2")); | ||
Task.WaitAll(t1, t2); | ||
}); | ||
} |
26 changes: 24 additions & 2 deletions
26
....Tests/Internals/MainExceptionProcessorTests.CreateSentryException_Aggregate.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
...s/Internals/MainExceptionProcessorTests.CreateSentryException_Aggregate_Keep.verified.txt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.