2 overrides of DeclareNewApiRule
Microsoft.CodeAnalysis.PublicApiAnalyzers.UnitTests (2)
DeclarePublicAPIAnalyzerTestsInternal.cs (1)
25
protected override DiagnosticDescriptor
DeclareNewApiRule
=> DeclarePublicApiAnalyzer.DeclareNewInternalApiRule;
DeclarePublicAPIAnalyzerTestsPublic.cs (1)
25
protected override DiagnosticDescriptor
DeclareNewApiRule
=> DeclarePublicApiAnalyzer.DeclareNewPublicApiRule;
47 references to DeclareNewApiRule
Microsoft.CodeAnalysis.PublicApiAnalyzers.UnitTests (47)
DeclarePublicAPIAnalyzerTestsBase.cs (47)
290
expectedDiagnostics = [GetCSharpResultAt(2, 8 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C")];
305
var expectedDiagnostics = new[] { GetCSharpResultAt(2, 8 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C") };
328
""", @"", @"", GetCSharpResultAt(2, 8 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C"));
354
GetCSharpResultAt(2, 8 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C"),
356
GetCSharpResultAt(2, 8 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C.C() -> void"),
358
GetCSharpResultAt(4, 10 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C.Field -> int"),
360
GetCSharpResultAt(5, 21 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C.Property.get -> int"),
362
GetCSharpResultAt(5, 26 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C.Property.set -> void"),
364
GetCSharpResultAt(6, 11 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C.Method() -> void"),
366
GetCSharpResultAt(7, 37 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C.ArrowExpressionProperty.get -> int"));
385
GetCSharpResultAt(2, 8 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C"),
387
GetCSharpResultAt(2, 8 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C.C() -> void"),
389
GetCSharpResultAt(4, 14 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, $"C.Field -> {message}"),
391
GetCSharpResultAt(5, 25 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, $"C.Property.get -> {message}"),
393
GetCSharpResultAt(5, 30 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C.Property.set -> void"),
395
GetCSharpResultAt(6, 11 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, $"C.Method({message} p) -> void"),
397
GetCSharpResultAt(7, 41 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, $"C.ArrowExpressionProperty.get -> {message}"));
426
GetBasicResultAt(4, 14,
DeclareNewApiRule
, "C"),
428
GetBasicResultAt(4, 14,
DeclareNewApiRule
, "C.New() -> Void"),
430
GetBasicResultAt(5, 12,
DeclareNewApiRule
, "C.Field -> Integer"),
432
GetBasicResultAt(8, 9,
DeclareNewApiRule
, "C.Property() -> Integer"),
434
GetBasicResultAt(11, 9,
DeclareNewApiRule
, "C.Property(Value As Integer) -> Void"),
436
GetBasicResultAt(17, 16,
DeclareNewApiRule
, "C.Method() -> Void"),
438
GetBasicResultAt(20, 30,
DeclareNewApiRule
, "C.ReadOnlyAutoProperty() -> Integer"),
440
GetBasicResultAt(21, 21,
DeclareNewApiRule
, "C.NormalAutoProperty() -> Integer"),
442
GetBasicResultAt(21, 21,
DeclareNewApiRule
, "C.NormalAutoProperty(AutoPropertyValue As Integer) -> Void"));
545
GetCSharpResultAt(2, 8 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C.C() -> void"));
706
var secondDiagnostic = new[] { GetCSharpResultAt(6, 11 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C.Method() -> void") };
1053
GetCSharpResultAt(2, 12,
DeclareNewApiRule
, $"System.Collections.Generic.IEnumerable<T> (forwarded, contained in {containingAssembly})"),
1055
GetCSharpResultAt(2, 12,
DeclareNewApiRule
, $"System.Collections.Generic.IEnumerable<T>.GetEnumerator() -> System.Collections.Generic.IEnumerator<T> (forwarded, contained in {containingAssembly})")
1083
GetCSharpResultAt(2, 12,
DeclareNewApiRule
, $"System.Collections.Generic.IEnumerable<string> (forwarded, contained in {containingAssembly})"),
1085
GetCSharpResultAt(2, 12,
DeclareNewApiRule
, $"System.Collections.Generic.IEnumerable<string>.GetEnumerator() -> System.Collections.Generic.IEnumerator<string> (forwarded, contained in {containingAssembly})")
1119
GetCSharpResultAt(5, 19,
DeclareNewApiRule
, "C.Method1(int p1, int p2, int p3 = 0) -> void"),
1121
GetCSharpResultAt(8, 19,
DeclareNewApiRule
, "C.Method1(char p1, params int[] p2) -> void"),
1127
GetCSharpResultAt(25, 19,
DeclareNewApiRule
, "C.Method5(int p1 = 0) -> void"),
1137
GetCSharpResultAt(5, 17,
DeclareNewApiRule
, "C.Method1(int p1, int p2, int p3 = 0) -> void"),
1139
GetCSharpResultAt(8, 17,
DeclareNewApiRule
, "C.Method1(char p1, params int[] p2) -> void"),
1143
GetCSharpResultAt(25, 17,
DeclareNewApiRule
, "C.Method5(int p1 = 0) -> void"),
1697
GetCSharpResultAt(10, 12 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "Other.Namespace.D"),
1699
GetCSharpResultAt(12, 10 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "Other.Namespace.D.D() -> void"));
1735
GetCSharpResultAt(line: 3, 12 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "My.Namespace.C"),
1737
GetCSharpResultAt(5, 10 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "My.Namespace.C.C() -> void"));
2120
GetCSharpResultAt(3, 15 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C"),
2122
GetCSharpResultAt(5, 18 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "static C.M<T>() -> void")
2136
GetCSharpResultAt(3, 15 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C<T>")
2155
GetCSharpResultAt(3, 15 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "~C<T1, T2>"),
2176
GetCSharpResultAt(3, 15 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "~C<T>"),