-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSA1141UnitTests.cs
More file actions
50 lines (44 loc) · 1.75 KB
/
Copy pathSA1141UnitTests.cs
File metadata and controls
50 lines (44 loc) · 1.75 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
47
48
49
50
// 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.ReadabilityRules
{
using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Testing;
using StyleCop.Analyzers.ReadabilityRules;
using Xunit;
using static StyleCop.Analyzers.Test.Verifiers.StyleCopCodeFixVerifier<
StyleCop.Analyzers.ReadabilityRules.SA1141UseTupleSyntax,
StyleCop.Analyzers.ReadabilityRules.SA1141CodeFixProvider>;
/// <summary>
/// This class contains the unit tests for SA1141.
/// </summary>
/// <seealso cref="SA1141UseTupleSyntax"/>
/// <seealso cref="SA1141CodeFixProvider"/>
public class SA1141UnitTests
{
/// <summary>
/// Verifies that usage of <see cref="ValueTuple{T1, T2}"/> will not produce a diagnostic when the language
/// version is restricted to C# 6.
/// </summary>
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
[Fact]
public async Task ValueTupleTypesDoNotProduceDiagnosticAsync()
{
var testCode = @"using System;
public class TestClass
{
public ValueTuple<int, int> TestMethod(ValueTuple<double, double> value)
{
return new ValueTuple<int, int>(1, 2);
}
public ValueTuple<int, int> TestProperty { get; set; }
}
";
await VerifyCSharpDiagnosticAsync(LanguageVersion.CSharp6, testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(true);
}
//// TODO: Make sure that all paths are covered!
}
}