Skip to content

Commit fac0a46

Browse files
committed
tests
1 parent 174c0f5 commit fac0a46

4 files changed

Lines changed: 6 additions & 9 deletions

File tree

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[![MIT](https://img.shields.io/github/license/Backs/Collections.Analyzer)](LICENSE)
2-
[![AppVeyor](https://img.shields.io/appveyor/build/Backs/CollectionsAnalyzer)](https://ci.appveyor.com/project/Backs/CollectionsAnalyzer)
32
[![Nuget](https://img.shields.io/nuget/v/Collections.Analyzer)](https://www.nuget.org/packages/Collections.Analyzer/)
43

54
Collections.Analyzer is a set of roslyn-based diagnostics for C#-projects that detect potential problems with operating

Tests/EnumerableTests/RedundantEnumerableToArrayConversionTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ public Task AsyncValueTaskEnumerableMethodToArrayTest()
3535
var code = ResourceReader.ReadFromFile("AsyncEnumerableMethodToArray2.txt");
3636

3737
return RedundantEnumerableToArrayConversionVerifier
38-
.VerifyAnalyzerAsync(code, DiagnosticResult.CompilerWarning("CI0003").WithSpan(15, 20, 15, 34),
39-
DiagnosticResult.CompilerError("CS0246").WithSpan(9, 29, 9, 56));
38+
.VerifyAnalyzerAsync(code, DiagnosticResult.CompilerWarning("CI0003").WithSpan(13, 20, 13, 34));
4039
}
4140

4241
[Test]

Tests/Resources/AsyncEnumerableMethodToArray2.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
namespace Examples
22
{
33
using System.Collections.Generic;
4-
using System.Linq;
54
using System.Threading.Tasks;
65

76
public class ReturnArray
87
{
98
public static async ValueTask<IEnumerable<int>> Method1()
109
{
11-
var list = new List<int>();
12-
10+
var list = new List<int> { 1 };
1311
await Task.CompletedTask;
1412

1513
return list.ToArray();

Tests/Tests.csproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net48</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<LangVersion>10</LangVersion>
66
<Nullable>enable</Nullable>
77
</PropertyGroup>
@@ -13,8 +13,9 @@
1313
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.NUnit" Version="1.1.2" />
1414
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.NUnit" Version="1.1.2" />
1515
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.13.0" PrivateAssets="all" />
16-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
17-
<PackageReference Include="NUnit3TestAdapter" Version="4.0.0" />
16+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
17+
<PackageReference Include="NUnit" Version="4.3.2" />
18+
<PackageReference Include="NUnit3TestAdapter" Version="4.3.2" />
1819
</ItemGroup>
1920
<ItemGroup>
2021
<EmbeddedResource Include="Resources\AddRangeAfter.txt" />

0 commit comments

Comments
 (0)