File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
test/Exceptionless.Tests/Plugins Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -498,6 +498,31 @@ public void ErrorPlugin_CopyExceptionDataToRootErrorData() {
498
498
}
499
499
}
500
500
501
+ [ Fact ]
502
+ public void ErrorPlugin_CopyExceptionData ( ) {
503
+ var errorPlugins = new List < IEventPlugin > {
504
+ new ErrorPlugin ( ) ,
505
+ new SimpleErrorPlugin ( )
506
+ } ;
507
+
508
+ foreach ( var plugin in errorPlugins ) {
509
+ var exception = new Exception ( "Test" ) {
510
+ Data = { { "Test" , "Test" } }
511
+ } ;
512
+
513
+ var client = CreateClient ( ) ;
514
+ var context = new EventPluginContext ( client , new Event ( ) ) ;
515
+ context . ContextData . SetException ( exception ) ;
516
+ plugin . Run ( context ) ;
517
+ Assert . False ( context . Cancel ) ;
518
+
519
+ var error = context . Event . GetError ( ) as IData ?? context . Event . GetSimpleError ( ) ;
520
+ Assert . NotNull ( error ) ;
521
+ Assert . Single ( error . Data ) ;
522
+ Assert . Equal ( "Test" , error . Data . GetString ( "Test" ) ) ;
523
+ }
524
+ }
525
+
501
526
[ Fact ]
502
527
public void ErrorPlugin_IgnoredProperties ( ) {
503
528
var exception = new MyApplicationException ( "Test" ) {
You can’t perform that action at this time.
0 commit comments