@@ -289,9 +289,52 @@ public void HandleAggregateExceptionsPlugin_SingleInnerException() {
289
289
plugin . Run ( context ) ;
290
290
Assert . True ( context . Cancel ) ;
291
291
}
292
-
292
+
293
+ [ Fact ]
294
+ public void HandleAggregateExceptionsPlugin_MultipleInnerException ( ) {
295
+ var submissionClient = new InMemorySubmissionClient ( ) ;
296
+ var client = new ExceptionlessClient ( "LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw" ) ;
297
+ client . Configuration . Resolver . Register < ISubmissionClient > ( submissionClient ) ;
298
+
299
+ var plugin = new HandleAggregateExceptionsPlugin ( ) ;
300
+ var exceptionOne = new Exception ( "one" ) ;
301
+ var exceptionTwo = new Exception ( "two" ) ;
302
+
303
+ var context = new EventPluginContext ( client , new Event ( ) ) ;
304
+ context . ContextData . SetException ( new AggregateException ( exceptionOne , exceptionTwo ) ) ;
305
+ plugin . Run ( context ) ;
306
+ Assert . True ( context . Cancel ) ;
307
+
308
+ client . ProcessQueue ( ) ;
309
+ Assert . Equal ( 2 , submissionClient . Events . Count ) ;
310
+ }
311
+
312
+ [ Fact ]
313
+ public void ErrorPlugin_WillPreserveLineBreaks ( ) {
314
+ const string message = "Test\r \n Line\r \n \t Breaks" ;
315
+
316
+ var errorPlugins = new List < IEventPlugin > {
317
+ new ErrorPlugin ( ) ,
318
+ new SimpleErrorPlugin ( )
319
+ } ;
320
+
321
+ var client = CreateClient ( ) ;
322
+ foreach ( var plugin in errorPlugins ) {
323
+ var context = new EventPluginContext ( client , new Event ( ) ) ;
324
+ context . ContextData . SetException ( new NotSupportedException ( message ) ) ;
325
+ plugin . Run ( context ) ;
326
+ Assert . False ( context . Cancel ) ;
327
+
328
+ var error = context . Event . GetError ( ) ;
329
+ if ( error != null )
330
+ Assert . Equal ( message , error . Message ) ;
331
+ else
332
+ Assert . Equal ( message , context . Event . GetSimpleError ( ) . Message ) ;
333
+ }
334
+ }
335
+
293
336
[ Fact ( Skip = "There is a bug in the .NET Framework where non thrown exceptions with non custom stack traces cannot be computed #116" ) ]
294
- public void CanHandleExceptionWithOverriddenStackTrace ( ) {
337
+ public void ErrorPlugin_CanHandleExceptionWithOverriddenStackTrace ( ) {
295
338
var client = CreateClient ( ) ;
296
339
var plugin = new ErrorPlugin ( ) ;
297
340
@@ -311,25 +354,6 @@ public void CanHandleExceptionWithOverriddenStackTrace() {
311
354
Assert . True ( error . StackTrace . Count > 0 ) ;
312
355
}
313
356
314
- [ Fact ]
315
- public void HandleAggregateExceptionsPlugin_MultipleInnerException ( ) {
316
- var submissionClient = new InMemorySubmissionClient ( ) ;
317
- var client = new ExceptionlessClient ( "LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw" ) ;
318
- client . Configuration . Resolver . Register < ISubmissionClient > ( submissionClient ) ;
319
-
320
- var plugin = new HandleAggregateExceptionsPlugin ( ) ;
321
- var exceptionOne = new Exception ( "one" ) ;
322
- var exceptionTwo = new Exception ( "two" ) ;
323
-
324
- var context = new EventPluginContext ( client , new Event ( ) ) ;
325
- context . ContextData . SetException ( new AggregateException ( exceptionOne , exceptionTwo ) ) ;
326
- plugin . Run ( context ) ;
327
- Assert . True ( context . Cancel ) ;
328
-
329
- client . ProcessQueue ( ) ;
330
- Assert . Equal ( 2 , submissionClient . Events . Count ) ;
331
- }
332
-
333
357
[ Fact ]
334
358
public void ErrorPlugin_DiscardDuplicates ( ) {
335
359
var errorPlugins = new List < IEventPlugin > {
0 commit comments