Skip to content

Commit 89b1487

Browse files
Added a new test project for c# 11
1 parent 9c5d064 commit 89b1487

257 files changed

Lines changed: 3352 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@
1919
[assembly: InternalsVisibleTo("StyleCop.Analyzers.Test.CSharp8, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c36d40d996fcc95fb6a89754728616758f459026e31478ce93633b3e27a4af416f103aa3d7a9e7998f829f8715cc1240d30724fd662042550fa71357b19562622424267e9e4640c403edbe64709a9ca5918128a9b9020b0db6e770d0dd1eac888869c23a835b74bde00e171984b1d1c24636cf030f0b23106e73035a2be145a6")]
2020
[assembly: InternalsVisibleTo("StyleCop.Analyzers.Test.CSharp9, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c36d40d996fcc95fb6a89754728616758f459026e31478ce93633b3e27a4af416f103aa3d7a9e7998f829f8715cc1240d30724fd662042550fa71357b19562622424267e9e4640c403edbe64709a9ca5918128a9b9020b0db6e770d0dd1eac888869c23a835b74bde00e171984b1d1c24636cf030f0b23106e73035a2be145a6")]
2121
[assembly: InternalsVisibleTo("StyleCop.Analyzers.Test.CSharp10, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c36d40d996fcc95fb6a89754728616758f459026e31478ce93633b3e27a4af416f103aa3d7a9e7998f829f8715cc1240d30724fd662042550fa71357b19562622424267e9e4640c403edbe64709a9ca5918128a9b9020b0db6e770d0dd1eac888869c23a835b74bde00e171984b1d1c24636cf030f0b23106e73035a2be145a6")]
22+
[assembly: InternalsVisibleTo("StyleCop.Analyzers.Test.CSharp11, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c36d40d996fcc95fb6a89754728616758f459026e31478ce93633b3e27a4af416f103aa3d7a9e7998f829f8715cc1240d30724fd662042550fa71357b19562622424267e9e4640c403edbe64709a9ca5918128a9b9020b0db6e770d0dd1eac888869c23a835b74bde00e171984b1d1c24636cf030f0b23106e73035a2be145a6")]
2223
[assembly: InternalsVisibleTo("StyleCopTester, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c36d40d996fcc95fb6a89754728616758f459026e31478ce93633b3e27a4af416f103aa3d7a9e7998f829f8715cc1240d30724fd662042550fa71357b19562622424267e9e4640c403edbe64709a9ca5918128a9b9020b0db6e770d0dd1eac888869c23a835b74bde00e171984b1d1c24636cf030f0b23106e73035a2be145a6")]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
3+
4+
#nullable disable
5+
6+
namespace StyleCop.Analyzers.Test.CSharp11
7+
{
8+
using StyleCop.Analyzers.Test.CSharp10;
9+
10+
public class AnalyzerConfigurationTestsCSharp11 : AnalyzerConfigurationTestsCSharp10
11+
{
12+
}
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
3+
4+
#nullable disable
5+
6+
namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
7+
{
8+
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;
9+
10+
public class CSharp11InheritdocCodeFixProviderUnitTests : CSharp10InheritdocCodeFixProviderUnitTests
11+
{
12+
}
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
3+
4+
#nullable disable
5+
6+
namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
7+
{
8+
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;
9+
10+
public class CSharp11NoXmlFileHeaderUnitTests : CSharp10NoXmlFileHeaderUnitTests
11+
{
12+
}
13+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
3+
4+
#nullable disable
5+
6+
namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
7+
{
8+
using Microsoft.CodeAnalysis.Testing;
9+
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;
10+
using static StyleCop.Analyzers.Test.Verifiers.StyleCopCodeFixVerifier<
11+
StyleCop.Analyzers.DocumentationRules.SA1600ElementsMustBeDocumented,
12+
StyleCop.Analyzers.DocumentationRules.SA1600CodeFixProvider>;
13+
14+
public class SA1600CSharp11UnitTests : SA1600CSharp10UnitTests
15+
{
16+
protected override DiagnosticResult[] GetExpectedResultTestRegressionMethodGlobalNamespace(string code)
17+
{
18+
if (code == "public void {|#0:TestMember|}() { }")
19+
{
20+
return new[]
21+
{
22+
// /0/Test0.cs(4,1): error CS0106: The modifier 'public' is not valid for this item
23+
DiagnosticResult.CompilerError("CS0106").WithSpan(4, 1, 4, 7).WithArguments("public"),
24+
25+
// /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.
26+
DiagnosticResult.CompilerError("CS8320").WithSpan(4, 1, 4, 29).WithArguments("top-level statements", "9.0"),
27+
28+
// /0/Test0.cs(4,1): error CS8805: Program using top-level statements must be an executable.
29+
DiagnosticResult.CompilerError("CS8805").WithSpan(4, 1, 4, 29),
30+
};
31+
}
32+
33+
return new[]
34+
{
35+
DiagnosticResult.CompilerError("CS0116").WithMessage("A namespace cannot directly contain members such as fields, methods or statements").WithLocation(0),
36+
Diagnostic().WithLocation(0),
37+
};
38+
}
39+
}
40+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
3+
4+
#nullable disable
5+
6+
namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
7+
{
8+
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;
9+
10+
public class SA1601CSharp11UnitTests : SA1601CSharp10UnitTests
11+
{
12+
}
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
3+
4+
#nullable disable
5+
6+
namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
7+
{
8+
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;
9+
10+
public class SA1602CSharp11UnitTests : SA1602CSharp10UnitTests
11+
{
12+
}
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
3+
4+
#nullable disable
5+
6+
namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
7+
{
8+
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;
9+
10+
public class SA1603CSharp11UnitTests : SA1603CSharp10UnitTests
11+
{
12+
}
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
3+
4+
#nullable disable
5+
6+
namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
7+
{
8+
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;
9+
10+
public class SA1604CSharp11UnitTests : SA1604CSharp10UnitTests
11+
{
12+
}
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
3+
4+
#nullable disable
5+
6+
namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
7+
{
8+
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;
9+
10+
public class SA1605CSharp11UnitTests : SA1605CSharp10UnitTests
11+
{
12+
}
13+
}

0 commit comments

Comments
 (0)