Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kamendov-maxim committed May 17, 2024
1 parent 1910595 commit 1907510
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions BubbleSort/BubbleSort.Tests/BubbleSort.Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public class Tests
{
private readonly int[] intArray = [6, 3, 89, 54, 2, 5, 2, 0, 1, 4, 7, 34, 76, 2, 6];
private readonly string[] stringArray = ["ddd", "aa", "c", "bbbb"];
private readonly List<List<int>> listOfLists = [[2, 2], [1], [4, 4, 4, 4], [3, 3, 3, 3]];
private readonly List<int>[] arrayOfLists = [[2, 2], [1], [4, 4, 4, 4], [3, 3, 3]];

[Test]
public void TestBubbleSortWithStringsAndComparerByLength()
Expand All @@ -15,12 +15,12 @@ public void TestBubbleSortWithStringsAndComparerByLength()
Assert.That(stringArray, Is.EqualTo(expectedResult));
}

public void TestBubbleSortOnListOfLIsts()
[Test]
public void TestBubbleSortOnArrayOfLists()
{
List<List<int>> expectedResult = [[1], [2, 2], [3, 3, 3, 3], [4, 4, 4, 4]];
Sorting.BubbleSort<List<int>>(listOfLists, Comparer<List<int>>.Create((List<int> a, List<int> b) => a.Count - b.Count));
Assert.That(listOfLists, Is.EqualTo(expectedResult));

List<int>[] expectedResult = [[1], [2, 2], [3, 3, 3], [4, 4, 4, 4]];
Sorting.BubbleSort<List<int>>(arrayOfLists, Comparer<List<int>>.Create((List<int> a, List<int> b) => a.Count - b.Count));
Assert.That(arrayOfLists, Is.EqualTo(expectedResult));
}

[Test]
Expand Down

0 comments on commit 1907510

Please sign in to comment.