Skip to content

Commit

Permalink
Move a Unit test to another file
Browse files Browse the repository at this point in the history
  • Loading branch information
gregory-paidis-sonarsource committed Nov 24, 2022
1 parent 5c933b8 commit 7db3613
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,6 @@ namespace Tests.Diagnostics
{
class MyClass
{
void IsPattern(List<int> list)
{
foreach (var item in list) // Noncompliant
{
if (item is 42) // Secondary
{
Console.WriteLine("The meaning of Life.");
}
}
}

void ListPattern(List<int[]> list)
{
foreach (int[] array in list) // Noncompliant
Expand Down
11 changes: 11 additions & 0 deletions analyzers/tests/SonarAnalyzer.UnitTest/TestCases/LoopsAndLinq.cs
Original file line number Diff line number Diff line change
Expand Up @@ -309,5 +309,16 @@ public class Point

public int GetX() => X;
}

void IsPattern(List<int> list)
{
foreach (var item in list) // Noncompliant
{
if (item is 42) // Secondary
{
Console.WriteLine("The meaning of Life.");
}
}
}
}
}

0 comments on commit 7db3613

Please sign in to comment.