@@ -14,6 +14,8 @@ namespace StyleCop.Analyzers.Test.DocumentationRules
1414 /// </summary>
1515 public class SA1634UnitTests : FileHeaderTestBase
1616 {
17+ private string multiLineSettings ;
18+
1719 /// <summary>
1820 /// Verifies that a file header without a copyright element will produce the expected diagnostic (none for the default case)
1921 /// </summary>
@@ -94,10 +96,46 @@ namespace Bar
9496 var expectedDiagnostic = this . CSharpDiagnostic ( FileHeaderAnalyzers . SA1634Descriptor ) . WithLocation ( 1 , 1 ) ;
9597 await this . VerifyCSharpDiagnosticAsync ( testCode , expectedDiagnostic , CancellationToken . None ) . ConfigureAwait ( false ) ;
9698 }
99+ /// <summary>
100+ /// Verifies that a file header with a copyright element will not produce a diagnostic message.
101+ /// </summary>
102+ /// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns>
103+ [ Fact ]
104+ public async Task TestValidMultiLineFileHeaderWithCopyrightLastAsync ( )
105+ {
106+ var testCode = @"// <author>
107+ // John Doe
108+ // </author>
109+ // <copyright file=""Test0.cs"" company=""FooCorp"">
110+ // Copyright (c) FooCorp. All rights reserved.
111+ // Licence is FooBar MIT.
112+ // </copyright>
113+
114+ namespace Bar
115+ {
116+ }
117+ " ;
118+ this . multiLineSettings = @"
119+ {
120+ ""settings"": {
121+ ""documentationRules"": {
122+ ""companyName"": ""FooCorp"",
123+ ""copyrightText"": ""Copyright (c) FooCorp. All rights reserved.\nLicence is FooBar MIT.""
124+ }
125+ }
126+ }
127+ " ;
128+ await this . VerifyCSharpDiagnosticAsync ( testCode , EmptyDiagnosticResults , CancellationToken . None ) . ConfigureAwait ( false ) ;
129+ }
97130
98131 protected override CodeFixProvider GetCSharpCodeFixProvider ( )
99132 {
100133 throw new System . NotImplementedException ( ) ;
101134 }
135+
136+ protected override string GetSettings ( )
137+ {
138+ return this . multiLineSettings ?? base . GetSettings ( ) ;
139+ }
102140 }
103141}
0 commit comments