Skip to content

Commit 4bb46b4

Browse files
committed
added new test file Instrumentation.Records to move all record topics to one test file
1 parent 8a6ef36 commit 4bb46b4

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace Coverlet.Core.CoverageSamples.Tests
8+
{
9+
public record RecordWithPropertyInit
10+
{
11+
private int _myRecordVal = 0;
12+
public RecordWithPropertyInit()
13+
{
14+
_myRecordVal = new Random().Next();
15+
}
16+
public string RecordAutoPropsNonInit { get; set; }
17+
public string RecordAutoPropsInit { get; set; } = string.Empty;
18+
}
19+
20+
public class ClassWithRecordsAutoProperties
21+
{
22+
record RecordWithPrimaryConstructor(string Prop1, string Prop2);
23+
24+
public ClassWithRecordsAutoProperties()
25+
{
26+
var record = new RecordWithPrimaryConstructor(string.Empty, string.Empty);
27+
}
28+
}
29+
30+
public class ClassWithInheritingRecordsAndAutoProperties
31+
{
32+
record BaseRecord(int A);
33+
34+
record InheritedRecord(int A) : BaseRecord(A);
35+
36+
public ClassWithInheritingRecordsAndAutoProperties()
37+
{
38+
var record = new InheritedRecord(1);
39+
}
40+
}
41+
42+
public class ClassWithRecordsEmptyPrimaryConstructor
43+
{
44+
internal record First
45+
{
46+
public string Bar() => "baz";
47+
}
48+
49+
internal record Second()
50+
{
51+
public string Bar() => "baz";
52+
}
53+
}
54+
55+
public class ClassWithAbstractRecords
56+
{
57+
public abstract record AuditData()
58+
{
59+
public abstract string GetAuditType();
60+
}
61+
62+
public abstract record AuditData
63+
{
64+
private protected AuditData()
65+
{
66+
67+
}
68+
69+
public abstract string GetAuditType();
70+
}
71+
}
72+
}

0 commit comments

Comments
 (0)