Skip to content

Commit 1c278a9

Browse files
committed
fix: expose constructor argument properties on custom data attributes to satisfy CA1019
1 parent 364ca57 commit 1c278a9

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/Atc.Test/ClassAutoNSubstituteDataAttribute.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,14 @@ public sealed class ClassAutoNSubstituteDataAttribute : ClassDataAttribute
1111
public ClassAutoNSubstituteDataAttribute(Type @class)
1212
: base(@class)
1313
{
14+
Class = @class;
1415
}
1516

17+
/// <summary>
18+
/// Gets the class type that provides the enumerable data.
19+
/// </summary>
20+
public new Type Class { get; }
21+
1622
public override async ValueTask<IReadOnlyCollection<ITheoryDataRow>> GetData(
1723
MethodInfo testMethod,
1824
DisposalTracker disposalTracker)

src/Atc.Test/MemberAutoNSubstituteDataAttribute.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,20 @@ public sealed class MemberAutoNSubstituteDataAttribute : MemberDataAttributeBase
1818
public MemberAutoNSubstituteDataAttribute(string memberName, params object[] parameters)
1919
: base(memberName, parameters)
2020
{
21+
MemberName = memberName;
22+
Parameters = parameters;
2123
}
2224

25+
/// <summary>
26+
/// Gets the member name passed to the constructor.
27+
/// </summary>
28+
public new string MemberName { get; }
29+
30+
/// <summary>
31+
/// Gets the parameter values passed to the constructor (for method members).
32+
/// </summary>
33+
public object[] Parameters { get; }
34+
2335
public override async ValueTask<IReadOnlyCollection<ITheoryDataRow>> GetData(
2436
MethodInfo testMethod,
2537
DisposalTracker disposalTracker)

0 commit comments

Comments
 (0)