Skip to content

Commit 4f16aa0

Browse files
committed
chore(test): Fix attribute test again
1 parent c4ba815 commit 4f16aa0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/coverlet.core.tests/Instrumentation/InstrumenterTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,20 @@ public void TestInstrument_ClassesWithExcludeAttributeAreExcluded(Type excludedT
7676
instrumenterTest.Directory.Delete(true);
7777
}
7878

79-
#pragma warning disable CS0612 // Type or member is obsolete
79+
8080
[Theory]
81-
[InlineData(nameof(ClassExcludedByObsoleteAttr))]
81+
[InlineData(nameof(ObsoleteAttribute))]
8282
[InlineData("Obsolete")]
83-
#pragma warning restore CS0612 // Type or member is obsolete
8483
public void TestInstrument_ClassesWithCustomExcludeAttributeAreExcluded(string excludedAttribute)
8584
{
86-
var instrumenterTest = CreateInstrumentor(attributesToIgnore: new string[] { nameof(ObsoleteAttribute) });
85+
var instrumenterTest = CreateInstrumentor(attributesToIgnore: new string[] { excludedAttribute });
8786
var result = instrumenterTest.Instrumenter.Instrument();
8887

8988
var doc = result.Documents.Values.FirstOrDefault(d => Path.GetFileName(d.Path) == "Samples.cs");
9089
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
9393
Assert.False(found, "Class decorated with with exclude attribute should be excluded");
9494

9595
instrumenterTest.Directory.Delete(true);

0 commit comments

Comments
 (0)