-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSA1313CSharp10UnitTests.cs
More file actions
46 lines (42 loc) · 1.37 KB
/
SA1313CSharp10UnitTests.cs
File metadata and controls
46 lines (42 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright (c) Contributors to the New StyleCop Analyzers project.
// Licensed under the MIT License. See LICENSE in the project root for license information.
namespace StyleCop.Analyzers.Test.CSharp10.NamingRules
{
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Testing;
using StyleCop.Analyzers.Test.CSharp9.NamingRules;
using Xunit;
using static StyleCop.Analyzers.Test.Verifiers.StyleCopCodeFixVerifier<
StyleCop.Analyzers.NamingRules.SA1313ParameterNamesMustBeginWithLowerCaseLetter,
StyleCop.Analyzers.NamingRules.RenameToLowerCaseCodeFixProvider>;
public partial class SA1313CSharp10UnitTests : SA1313CSharp9UnitTests
{
[Theory]
[WorkItem(3384, "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3384")]
[InlineData("class")]
[InlineData("struct")]
public async Task TestRecordTypeAsync(string typeKind)
{
var testCode = $@"
public record {typeKind} R(int A)
{{
public R(int [|A|], int [|B|])
: this(A)
{{
}}
}}
";
var fixedCode = $@"
public record {typeKind} R(int A)
{{
public R(int a, int b)
: this(a)
{{
}}
}}
";
await VerifyCSharpFixAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, fixedCode, CancellationToken.None).ConfigureAwait(true);
}
}
}