Skip to content

Commit b28dde7

Browse files
committed
refactored tests
1 parent 39eebcd commit b28dde7

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

test/coverlet.core.coverage.tests/Coverage/CoverageTests.Records.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,9 @@ public void SkipInheritingRecordsWithPropertiesABCDEF(bool skipAutoProps)
220220
TestInstrumentationHelper.GetCoverageResult(path)
221221
.GenerateReport(show: true)
222222
.Document("Instrumentation.Records.cs")
223-
.AssertNonInstrumentedLines(BuildConfiguration.Debug, 39, 39)
224-
.AssertNonInstrumentedLines(BuildConfiguration.Release, 39, 39)
225-
.AssertLinesCovered(BuildConfiguration.Debug, (41, 1), (44, 1), (45, 1), (46, 1))
223+
//.AssertNonInstrumentedLines(BuildConfiguration.Debug, 39, 39)
224+
//.AssertNonInstrumentedLines(BuildConfiguration.Release, 39, 39)
225+
.AssertLinesCovered(BuildConfiguration.Debug, (67, 1), (69, 1), (77, 1), (78, 1), (79, 1), (85, 1), (86, 1), (87, 1))
226226
.AssertLinesCovered(BuildConfiguration.Release, (45, 1));
227227

228228
}
@@ -231,8 +231,8 @@ public void SkipInheritingRecordsWithPropertiesABCDEF(bool skipAutoProps)
231231
TestInstrumentationHelper.GetCoverageResult(path)
232232
.GenerateReport(show: true)
233233
.Document("Instrumentation.Records.cs")
234-
.AssertLinesCovered(BuildConfiguration.Debug, (39, 1), (41, 1), (44, 1), (45, 1), (46, 1))
235-
.AssertLinesCovered(BuildConfiguration.Release, (39, 1), (41, 1), (45, 1));
234+
.AssertLinesCovered(BuildConfiguration.Debug, (59, 1), (66, 1), (67, 1), (69, 1), (77, 1), (78, 1), (79, 1), (85, 1), (86, 1), (87, 1));
235+
//.AssertLinesCovered(BuildConfiguration.Release, (39, 1), (41, 1), (45, 1));
236236
}
237237
}
238238
finally

test/coverlet.core.coverage.tests/Samples/Instrumentation.Records.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,27 @@ private protected SecondAuditData()
7070

7171
public abstract string GetAuditType();
7272
}
73+
74+
public record ConcreteFirstAuditData : FirstAuditData
75+
{
76+
public override string GetAuditType()
77+
{
78+
return string.Empty;
79+
}
80+
}
81+
82+
public record ConcreteSecondAuditData : SecondAuditData
83+
{
84+
public override string GetAuditType()
85+
{
86+
return string.Empty;
87+
}
88+
}
89+
90+
public ClassWithAbstractRecords()
91+
{
92+
new ConcreteFirstAuditData().GetAuditType();
93+
new ConcreteSecondAuditData().GetAuditType();
94+
}
7395
}
7496
}

0 commit comments

Comments
 (0)