@@ -43,18 +43,18 @@ public void ConfigurationDefaults_EnsureNoDuplicateTagsOrData() {
43
43
44
44
var plugin = new ConfigurationDefaultsPlugin ( ) ;
45
45
plugin . Run ( context ) ;
46
- Assert . Equal ( 0 , context . Event . Tags . Count ) ;
46
+ Assert . Empty ( context . Event . Tags ) ;
47
47
48
48
client . Configuration . DefaultTags . Add ( Event . KnownTags . Critical ) ;
49
49
plugin . Run ( context ) ;
50
- Assert . Equal ( 1 , context . Event . Tags . Count ) ;
51
- Assert . Equal ( 0 , context . Event . Data . Count ) ;
50
+ Assert . Single ( context . Event . Tags ) ;
51
+ Assert . Empty ( context . Event . Data ) ;
52
52
53
53
client . Configuration . DefaultData . Add ( "Message" , new { Exceptionless = "Is Awesome!" } ) ;
54
54
for ( int index = 0 ; index < 2 ; index ++ ) {
55
55
plugin . Run ( context ) ;
56
- Assert . Equal ( 1 , context . Event . Tags . Count ) ;
57
- Assert . Equal ( 1 , context . Event . Data . Count ) ;
56
+ Assert . Single ( context . Event . Tags ) ;
57
+ Assert . Single ( context . Event . Data ) ;
58
58
}
59
59
}
60
60
@@ -66,13 +66,13 @@ public void ConfigurationDefaults_IgnoredProperties() {
66
66
var context = new EventPluginContext ( client , new Event ( ) ) ;
67
67
var plugin = new ConfigurationDefaultsPlugin ( ) ;
68
68
plugin . Run ( context ) ;
69
- Assert . Equal ( 1 , context . Event . Data . Count ) ;
69
+ Assert . Single ( context . Event . Data ) ;
70
70
Assert . Equal ( "Test" , context . Event . Data [ "Message" ] ) ;
71
71
72
72
client . Configuration . AddDataExclusions ( "Ignore*" ) ;
73
73
client . Configuration . DefaultData . Add ( "Ignored" , "Test" ) ;
74
74
plugin . Run ( context ) ;
75
- Assert . Equal ( 1 , context . Event . Data . Count ) ;
75
+ Assert . Single ( context . Event . Data ) ;
76
76
Assert . Equal ( "Test" , context . Event . Data [ "Message" ] ) ;
77
77
}
78
78
@@ -402,7 +402,7 @@ public void ErrorPlugin_DiscardDuplicates() {
402
402
plugin . Run ( context ) ;
403
403
Assert . False ( context . Cancel ) ;
404
404
405
- IData error = context . Event . GetError ( ) as IData ?? context . Event . GetSimpleError ( ) ;
405
+ var error = context . Event . GetError ( ) as IData ?? context . Event . GetSimpleError ( ) ;
406
406
Assert . NotNull ( error ) ;
407
407
408
408
context = new EventPluginContext ( client , new Event ( ) ) ;
@@ -441,7 +441,7 @@ public static IEnumerable<object[]> DifferentExceptionDataDictionaryTypes {
441
441
}
442
442
443
443
[ Theory ]
444
- [ MemberData ( " DifferentExceptionDataDictionaryTypes" ) ]
444
+ [ MemberData ( nameof ( DifferentExceptionDataDictionaryTypes ) ) ]
445
445
public void ErrorPlugin_CanProcessDifferentExceptionDataDictionaryTypes ( IDictionary data , bool canMarkAsProcessed , int processedDataItemCount ) {
446
446
var errorPlugins = new List < IEventPlugin > {
447
447
new ErrorPlugin ( ) ,
@@ -462,7 +462,7 @@ public void ErrorPlugin_CanProcessDifferentExceptionDataDictionaryTypes(IDiction
462
462
463
463
Assert . Equal ( canMarkAsProcessed , exception . Data != null && exception . Data . Contains ( "@exceptionless" ) ) ;
464
464
465
- IData error = context . Event . GetError ( ) as IData ?? context . Event . GetSimpleError ( ) ;
465
+ var error = context . Event . GetError ( ) as IData ?? context . Event . GetSimpleError ( ) ;
466
466
Assert . NotNull ( error ) ;
467
467
Assert . Equal ( processedDataItemCount , error . Data . Count ) ;
468
468
}
@@ -492,7 +492,7 @@ public void ErrorPlugin_CopyExceptionDataToRootErrorData() {
492
492
plugin . Run ( context ) ;
493
493
Assert . False ( context . Cancel ) ;
494
494
495
- IData error = context . Event . GetError ( ) as IData ?? context . Event . GetSimpleError ( ) ;
495
+ var error = context . Event . GetError ( ) as IData ?? context . Event . GetSimpleError ( ) ;
496
496
Assert . NotNull ( error ) ;
497
497
Assert . Equal ( 5 , error . Data . Count ) ;
498
498
}
@@ -516,10 +516,10 @@ public void ErrorPlugin_IgnoredProperties() {
516
516
context . ContextData . SetException ( exception ) ;
517
517
518
518
plugin . Run ( context ) ;
519
- IData error = context . Event . GetError ( ) as IData ?? context . Event . GetSimpleError ( ) ;
519
+ var error = context . Event . GetError ( ) as IData ?? context . Event . GetSimpleError ( ) ;
520
520
Assert . NotNull ( error ) ;
521
521
Assert . True ( error . Data . ContainsKey ( Error . KnownDataKeys . ExtraProperties ) ) ;
522
- var json = error . Data [ Error . KnownDataKeys . ExtraProperties ] as string ;
522
+ string json = error . Data [ Error . KnownDataKeys . ExtraProperties ] as string ;
523
523
Assert . Equal ( "{\" IgnoredProperty\" :\" Test\" ,\" RandomValue\" :\" Test\" }" , json ) ;
524
524
525
525
client . Configuration . AddDataExclusions ( "Ignore*" ) ;
@@ -541,15 +541,15 @@ public void CanAddPluginConcurrently() {
541
541
foreach ( var plugin in client . Configuration . Plugins )
542
542
client . Configuration . RemovePlugin ( plugin . Key ) ;
543
543
544
- Assert . Equal ( 0 , client . Configuration . Plugins . Count ( ) ) ;
544
+ Assert . Empty ( client . Configuration . Plugins ) ;
545
545
546
546
Parallel . For ( 0 , 1000 , i => {
547
547
client . Configuration . AddPlugin < EnvironmentInfoPlugin > ( ) ;
548
548
} ) ;
549
549
550
- Assert . Equal ( 1 , client . Configuration . Plugins . Count ( ) ) ;
550
+ Assert . Single ( client . Configuration . Plugins ) ;
551
551
client . Configuration . RemovePlugin < EnvironmentInfoPlugin > ( ) ;
552
- Assert . Equal ( 0 , client . Configuration . Plugins . Count ( ) ) ;
552
+ Assert . Empty ( client . Configuration . Plugins ) ;
553
553
}
554
554
555
555
[ Fact ]
@@ -561,7 +561,7 @@ public void EnvironmentInfo_CanRunInParallel() {
561
561
Parallel . For ( 0 , 10000 , i => {
562
562
var context = new EventPluginContext ( client , ev ) ;
563
563
plugin . Run ( context ) ;
564
- Assert . Equal ( 1 , context . Event . Data . Count ) ;
564
+ Assert . Single ( context . Event . Data ) ;
565
565
Assert . NotNull ( context . Event . Data [ Event . KnownDataKeys . EnvironmentInfo ] ) ;
566
566
} ) ;
567
567
}
@@ -573,7 +573,7 @@ public void EnvironmentInfo_ShouldAddSessionStart() {
573
573
574
574
var plugin = new EnvironmentInfoPlugin ( ) ;
575
575
plugin . Run ( context ) ;
576
- Assert . Equal ( 1 , context . Event . Data . Count ) ;
576
+ Assert . Single ( context . Event . Data ) ;
577
577
Assert . NotNull ( context . Event . Data [ Event . KnownDataKeys . EnvironmentInfo ] ) ;
578
578
}
579
579
@@ -589,7 +589,7 @@ public void CanCancel() {
589
589
var context = new EventPluginContext ( client , new Event ( ) ) ;
590
590
EventPluginManager . Run ( context ) ;
591
591
Assert . True ( context . Cancel ) ;
592
- Assert . Equal ( 0 , context . Event . Tags . Count ) ;
592
+ Assert . Empty ( context . Event . Tags ) ;
593
593
}
594
594
595
595
[ Fact ]
@@ -725,7 +725,7 @@ public void VerifyPriority() {
725
725
foreach ( var plugin in config . Plugins )
726
726
config . RemovePlugin ( plugin . Key ) ;
727
727
728
- Assert . Equal ( 0 , config . Plugins . Count ( ) ) ;
728
+ Assert . Empty ( config . Plugins ) ;
729
729
config . AddPlugin < EnvironmentInfoPlugin > ( ) ;
730
730
config . AddPlugin < PluginWithPriority11 > ( ) ;
731
731
config . AddPlugin ( new PluginWithNoPriority ( ) ) ;
@@ -887,7 +887,7 @@ public void RunBenchmark() {
887
887
foreach ( var report in summary . Reports ) {
888
888
_writer . WriteLine ( report . ToString ( ) ) ;
889
889
890
- var benchmarkMedianMilliseconds = report . ResultStatistics != null ? report . ResultStatistics . Median / 1000000 : 0 ;
890
+ double benchmarkMedianMilliseconds = report . ResultStatistics != null ? report . ResultStatistics . Median / 1000000 : 0 ;
891
891
_writer . WriteLine ( String . Format ( "{0} - {1:0.00}ms" , report . Benchmark . DisplayInfo , benchmarkMedianMilliseconds ) ) ;
892
892
}
893
893
}
0 commit comments