|
3 | 3 |
|
4 | 4 | namespace StyleCop.Analyzers.Test.CSharp10.DocumentationRules |
5 | 5 | { |
| 6 | + using Microsoft.CodeAnalysis.Testing; |
6 | 7 | using StyleCop.Analyzers.Test.CSharp9.DocumentationRules; |
| 8 | + using static StyleCop.Analyzers.Test.Verifiers.StyleCopCodeFixVerifier< |
| 9 | + StyleCop.Analyzers.DocumentationRules.SA1600ElementsMustBeDocumented, |
| 10 | + StyleCop.Analyzers.DocumentationRules.SA1600CodeFixProvider>; |
7 | 11 |
|
8 | 12 | public class SA1600CSharp10UnitTests : SA1600CSharp9UnitTests |
9 | 13 | { |
| 14 | + protected override DiagnosticResult[] GetExpectedResultTestRegressionMethodGlobalNamespace(string code) |
| 15 | + { |
| 16 | + if (code == "public void {|#0:TestMember|}() { }") |
| 17 | + { |
| 18 | + return new[] |
| 19 | + { |
| 20 | + // /0/Test0.cs(4,1): error CS0106: The modifier 'public' is not valid for this item |
| 21 | + DiagnosticResult.CompilerError("CS0106").WithSpan(4, 1, 4, 7).WithArguments("public"), |
| 22 | + |
| 23 | + // /0/Test0.cs(4,1): error CS8320: Feature 'top-level statements' is not available in C# 7.2. Please use language version 9.0 or greater. |
| 24 | + DiagnosticResult.CompilerError("CS8320").WithSpan(4, 1, 4, 29).WithArguments("top-level statements", "9.0"), |
| 25 | + |
| 26 | + // /0/Test0.cs(4,1): error CS8805: Program using top-level statements must be an executable. |
| 27 | + DiagnosticResult.CompilerError("CS8805").WithSpan(4, 1, 4, 29), |
| 28 | + }; |
| 29 | + } |
| 30 | + |
| 31 | + return new[] |
| 32 | + { |
| 33 | + DiagnosticResult.CompilerError("CS0116").WithMessage("A namespace cannot directly contain members such as fields, methods or statements").WithLocation(0), |
| 34 | + Diagnostic().WithLocation(0), |
| 35 | + }; |
| 36 | + } |
10 | 37 | } |
11 | 38 | } |
0 commit comments