File tree Expand file tree Collapse file tree
StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp8/LayoutRules Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44namespace StyleCop . Analyzers . Test . CSharp8 . LayoutRules
55{
6+ using System . Threading ;
7+ using System . Threading . Tasks ;
8+ using Microsoft . CodeAnalysis . Testing ;
69 using StyleCop . Analyzers . Test . CSharp7 . LayoutRules ;
10+ using Xunit ;
11+ using static StyleCop . Analyzers . Test . Verifiers . StyleCopCodeFixVerifier <
12+ StyleCop . Analyzers . LayoutRules . SA1514ElementDocumentationHeaderMustBePrecededByBlankLine ,
13+ StyleCop . Analyzers . LayoutRules . SA1514CodeFixProvider > ;
714
815 public class SA1514CSharp8UnitTests : SA1514CSharp7UnitTests
916 {
17+ /// <summary>
18+ /// Verifies that method-like declarations with invalid documentation will produce the expected diagnostics.
19+ /// </summary>
20+ /// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns>
21+ [ Fact ]
22+ public async Task TestValidPropertyDeclarationAsync ( )
23+ {
24+ var testCode = @"namespace TestNamespace
25+ {
26+ public class TestClass
27+ {
28+ /// <summary>
29+ /// Gets or sets the value.
30+ /// </summary>
31+ public string SomeString { get; set; } = null!;
32+
33+ /// <summary>
34+ /// Gets or sets the value.
35+ /// </summary>
36+ public string AnotherString { get; set; } = null!;
37+ }
38+ }
39+ " ;
40+
41+ await VerifyCSharpDiagnosticAsync ( testCode , DiagnosticResult . EmptyDiagnosticResults , CancellationToken . None ) . ConfigureAwait ( false ) ;
42+ }
1043 }
1144}
You can’t perform that action at this time.
0 commit comments