Skip to content

Commit 0105792

Browse files
committed
Remove no longer needed "AssertMatrix" from "Transpose" tests
1 parent c6d3c0c commit 0105792

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

MoreLinq.Test/TransposeTest.cs

+4-17
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public void TransposeWithRowsOfSameLength()
5858
using var row3 = TestingSequence.Of(30, 31, 32, 33);
5959
using var matrix = TestingSequence.Of(row1, row2, row3);
6060

61-
AssertMatrix(expectations, matrix.Transpose());
61+
Assert.That(matrix.Transpose(), Is.EqualTo(expectations));
6262
}
6363

6464
[Test]
@@ -77,7 +77,7 @@ public void TransposeWithRowsOfDifferentLengths()
7777
using var row4 = TestingSequence.Of(30, 31, 32);
7878
using var matrix = TestingSequence.Of(row1, row2, row3, row4);
7979

80-
AssertMatrix(expectations, matrix.Transpose());
80+
Assert.That(matrix.Transpose(), Is.EqualTo(expectations));
8181
}
8282

8383
[Test]
@@ -116,7 +116,7 @@ public void TransposeWithAllRowsAsInfiniteSequences()
116116
[32, 243, 3125]
117117
};
118118

119-
AssertMatrix(expectations, result);
119+
Assert.That(result, Is.EqualTo(expectations));
120120
}
121121

122122
[Test]
@@ -139,7 +139,7 @@ public void TransposeWithSomeRowsAsInfiniteSequences()
139139
[32, 3125]
140140
};
141141

142-
AssertMatrix(expectations, result);
142+
Assert.That(result, Is.EqualTo(expectations));
143143
}
144144

145145
[Test]
@@ -207,18 +207,5 @@ static bool IsPrime(int number)
207207

208208
return true;
209209
}
210-
211-
static void AssertMatrix<T>(IEnumerable<IEnumerable<T>> expectation, IEnumerable<IEnumerable<T>> result)
212-
{
213-
// necessary because NUnitLite 3.6.1 (.NET 4.5) for Mono don't assert nested enumerables
214-
215-
var resultList = result.ToList();
216-
var expectationList = expectation.ToList();
217-
218-
Assert.That(resultList.Count, Is.EqualTo(expectationList.Count));
219-
220-
expectationList.Zip(resultList, ValueTuple.Create)
221-
.ForEach(t => t.Item1.AssertSequenceEqual(t.Item2));
222-
}
223210
}
224211
}

0 commit comments

Comments
 (0)