File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
test/coverlet.core.tests/Instrumentation Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -76,20 +76,20 @@ public void TestInstrument_ClassesWithExcludeAttributeAreExcluded(Type excludedT
76
76
instrumenterTest . Directory . Delete ( true ) ;
77
77
}
78
78
79
- #pragma warning disable CS0612 // Type or member is obsolete
79
+
80
80
[ Theory ]
81
- [ InlineData ( nameof ( ClassExcludedByObsoleteAttr ) ) ]
81
+ [ InlineData ( nameof ( ObsoleteAttribute ) ) ]
82
82
[ InlineData ( "Obsolete" ) ]
83
- #pragma warning restore CS0612 // Type or member is obsolete
84
83
public void TestInstrument_ClassesWithCustomExcludeAttributeAreExcluded ( string excludedAttribute )
85
84
{
86
- var instrumenterTest = CreateInstrumentor ( attributesToIgnore : new string [ ] { nameof ( ObsoleteAttribute ) } ) ;
85
+ var instrumenterTest = CreateInstrumentor ( attributesToIgnore : new string [ ] { excludedAttribute } ) ;
87
86
var result = instrumenterTest . Instrumenter . Instrument ( ) ;
88
87
89
88
var doc = result . Documents . Values . FirstOrDefault ( d => Path . GetFileName ( d . Path ) == "Samples.cs" ) ;
90
89
Assert . NotNull ( doc ) ;
91
-
92
- var found = doc . Lines . Values . Any ( l => l . Class . Equals ( excludedAttribute ) ) ;
90
+ #pragma warning disable CS0612 // Type or member is obsolete
91
+ var found = doc . Lines . Values . Any ( l => l . Class . Equals ( nameof ( ClassExcludedByObsoleteAttr ) ) ) ;
92
+ #pragma warning restore CS0612 // Type or member is obsolete
93
93
Assert . False ( found , "Class decorated with with exclude attribute should be excluded" ) ;
94
94
95
95
instrumenterTest . Directory . Delete ( true ) ;
You can’t perform that action at this time.
0 commit comments