Skip to content

Commit c3a4909

Browse files
committed
Update SA1633 for nullable reference types
1 parent b72b3f7 commit c3a4909

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp8/DocumentationRules/SA1633CSharp8UnitTests.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,30 @@
33

44
namespace StyleCop.Analyzers.Test.CSharp8.DocumentationRules
55
{
6+
using System.Threading;
7+
using System.Threading.Tasks;
8+
using StyleCop.Analyzers.DocumentationRules;
69
using StyleCop.Analyzers.Test.CSharp7.DocumentationRules;
10+
using Xunit;
711

812
public partial class SA1633CSharp8UnitTests : SA1633CSharp7UnitTests
913
{
14+
[Fact]
15+
[WorkItem(3006, "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3006")]
16+
public async Task TestNullableDirectiveBeforeFileHeaderAsync()
17+
{
18+
var testCode = @"#nullable enable
19+
// <copyright file=""Test0.cs"" company=""FooCorp"">
20+
// Copyright (c) FooCorp. All rights reserved.
21+
// </copyright>
22+
23+
namespace TestNamespace
24+
{
25+
}
26+
";
27+
28+
var expected = Diagnostic(FileHeaderAnalyzers.SA1633DescriptorMissing).WithLocation(1, 1);
29+
await this.VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None).ConfigureAwait(false);
30+
}
1031
}
1132
}

StyleCop.Analyzers/StyleCop.Analyzers.Test/DocumentationRules/SA1633UnitTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

4-
#nullable disable
5-
64
namespace StyleCop.Analyzers.Test.DocumentationRules
75
{
86
using System.Threading;

0 commit comments

Comments
 (0)