File tree Expand file tree Collapse file tree 2 files changed +28
-2
lines changed
StyleCop.Analyzers.Test.CSharp9/DocumentationRules
StyleCop.Analyzers.Test/DocumentationRules Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change 33
44namespace StyleCop . Analyzers . Test . CSharp9 . DocumentationRules
55{
6+ using System . Threading ;
7+ using System . Threading . Tasks ;
68 using StyleCop . Analyzers . Test . CSharp8 . DocumentationRules ;
9+ using Xunit ;
10+ using static StyleCop . Analyzers . Test . Verifiers . CustomDiagnosticVerifier < StyleCop . Analyzers . DocumentationRules . SA1618GenericTypeParametersMustBeDocumented > ;
711
812 public partial class SA1618CSharp9UnitTests : SA1618CSharp8UnitTests
913 {
14+ [ Fact ]
15+ [ WorkItem ( 3971 , "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3971" ) ]
16+ public async Task TestPartialMethodDeclarationMissingTypeParameterDocumentationAsync ( )
17+ {
18+ var testCode = @"
19+ /// <summary>
20+ /// Tests a partial method.
21+ /// </summary>
22+ public partial class TestClass
23+ {
24+ /// <summary>Declaration.</summary>
25+ public partial void TestMethod<{|#0:T|}>();
26+
27+ public partial void TestMethod<T>()
28+ {
29+ }
30+ }" ;
31+
32+ var expected = Diagnostic ( ) . WithLocation ( 0 ) . WithArguments ( "T" ) ;
33+
34+ await VerifyCSharpDiagnosticAsync ( testCode , new [ ] { expected } , CancellationToken . None ) . ConfigureAwait ( false ) ;
35+ }
1036 }
1137}
Original file line number Diff line number Diff line change @@ -427,10 +427,10 @@ private void Test2<T>(int arg) { }
427427 await VerifyCSharpDiagnosticAsync ( testCode , DiagnosticResult . EmptyDiagnosticResults , CancellationToken . None ) . ConfigureAwait ( false ) ;
428428 }
429429
430- private static Task VerifyCSharpDiagnosticAsync ( string source , DiagnosticResult expected , CancellationToken cancellationToken )
430+ protected static Task VerifyCSharpDiagnosticAsync ( string source , DiagnosticResult expected , CancellationToken cancellationToken )
431431 => VerifyCSharpDiagnosticAsync ( source , new [ ] { expected } , cancellationToken ) ;
432432
433- private static Task VerifyCSharpDiagnosticAsync ( string source , DiagnosticResult [ ] expected , CancellationToken cancellationToken )
433+ protected static Task VerifyCSharpDiagnosticAsync ( string source , DiagnosticResult [ ] expected , CancellationToken cancellationToken )
434434 {
435435 string contentClassWithTypeparamDoc = @"<?xml version=""1.0"" encoding=""utf-8"" ?>
436436<TestClass>
You can’t perform that action at this time.
0 commit comments