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)
311
expectedDiagnostics = new[] { GetCSharpResultAt(2, 8 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C") };
331
var expectedDiagnostics = new[] { GetCSharpResultAt(2, 8 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C") };
361
await VerifyCSharpAsync(source, shippedText, unshippedText, GetCSharpResultAt(2, 8 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C"));
401
GetCSharpResultAt(2, 8 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C"),
403
GetCSharpResultAt(2, 8 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C.C() -> void"),
405
GetCSharpResultAt(4, 10 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C.Field -> int"),
407
GetCSharpResultAt(5, 21 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C.Property.get -> int"),
409
GetCSharpResultAt(5, 26 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C.Property.set -> void"),
411
GetCSharpResultAt(6, 11 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C.Method() -> void"),
413
GetCSharpResultAt(7, 37 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C.ArrowExpressionProperty.get -> int"));
439
GetCSharpResultAt(2, 8 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C"),
441
GetCSharpResultAt(2, 8 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C.C() -> void"),
443
GetCSharpResultAt(4, 14 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, $"C.Field -> {message}"),
445
GetCSharpResultAt(5, 25 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, $"C.Property.get -> {message}"),
447
GetCSharpResultAt(5, 30 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C.Property.set -> void"),
449
GetCSharpResultAt(6, 11 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, $"C.Method({message} p) -> void"),
451
GetCSharpResultAt(7, 41 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, $"C.ArrowExpressionProperty.get -> {message}"));
487
GetBasicResultAt(4, 14,
DeclareNewApiRule
, "C"),
489
GetBasicResultAt(4, 14,
DeclareNewApiRule
, "C.New() -> Void"),
491
GetBasicResultAt(5, 12,
DeclareNewApiRule
, "C.Field -> Integer"),
493
GetBasicResultAt(8, 9,
DeclareNewApiRule
, "C.Property() -> Integer"),
495
GetBasicResultAt(11, 9,
DeclareNewApiRule
, "C.Property(Value As Integer) -> Void"),
497
GetBasicResultAt(17, 16,
DeclareNewApiRule
, "C.Method() -> Void"),
499
GetBasicResultAt(20, 30,
DeclareNewApiRule
, "C.ReadOnlyAutoProperty() -> Integer"),
501
GetBasicResultAt(21, 21,
DeclareNewApiRule
, "C.NormalAutoProperty() -> Integer"),
503
GetBasicResultAt(21, 21,
DeclareNewApiRule
, "C.NormalAutoProperty(AutoPropertyValue As Integer) -> Void"));
628
GetCSharpResultAt(2, 8 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C.C() -> void"));
805
var secondDiagnostic = new[] { GetCSharpResultAt(6, 11 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C.Method() -> void") };
1196
GetCSharpResultAt(2, 12,
DeclareNewApiRule
, $"System.Collections.Generic.IEnumerable<T> (forwarded, contained in {containingAssembly})"),
1198
GetCSharpResultAt(2, 12,
DeclareNewApiRule
, $"System.Collections.Generic.IEnumerable<T>.GetEnumerator() -> System.Collections.Generic.IEnumerator<T> (forwarded, contained in {containingAssembly})")
1229
GetCSharpResultAt(2, 12,
DeclareNewApiRule
, $"System.Collections.Generic.IEnumerable<string> (forwarded, contained in {containingAssembly})"),
1231
GetCSharpResultAt(2, 12,
DeclareNewApiRule
, $"System.Collections.Generic.IEnumerable<string>.GetEnumerator() -> System.Collections.Generic.IEnumerator<string> (forwarded, contained in {containingAssembly})")
1306
GetCSharpResultAt(5, 19,
DeclareNewApiRule
, "C.Method1(int p1, int p2, int p3 = 0) -> void"),
1308
GetCSharpResultAt(8, 19,
DeclareNewApiRule
, "C.Method1(char p1, params int[] p2) -> void"),
1314
GetCSharpResultAt(25, 19,
DeclareNewApiRule
, "C.Method5(int p1 = 0) -> void"),
1324
GetCSharpResultAt(5, 17,
DeclareNewApiRule
, "C.Method1(int p1, int p2, int p3 = 0) -> void"),
1326
GetCSharpResultAt(8, 17,
DeclareNewApiRule
, "C.Method1(char p1, params int[] p2) -> void"),
1330
GetCSharpResultAt(25, 17,
DeclareNewApiRule
, "C.Method5(int p1 = 0) -> void"),
1940
GetCSharpResultAt(10, 12 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "Other.Namespace.D"),
1942
GetCSharpResultAt(12, 10 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "Other.Namespace.D.D() -> void"));
1982
GetCSharpResultAt(line: 3, 12 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "My.Namespace.C"),
1984
GetCSharpResultAt(5, 10 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "My.Namespace.C.C() -> void"));
2432
GetCSharpResultAt(3, 15 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C"),
2434
GetCSharpResultAt(5, 18 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "static C.M<T>() -> void")
2453
GetCSharpResultAt(3, 15 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "C<T>")
2477
GetCSharpResultAt(3, 15 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "~C<T1, T2>"),
2503
GetCSharpResultAt(3, 15 + EnabledModifierCSharp.Length,
DeclareNewApiRule
, "~C<T>"),