From 010579286b0f412c881970682ea752192da13dc4 Mon Sep 17 00:00:00 2001 From: Atif Aziz Date: Sun, 22 Sep 2024 20:31:03 +0200 Subject: [PATCH] Remove no longer needed "AssertMatrix" from "Transpose" tests --- MoreLinq.Test/TransposeTest.cs | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/MoreLinq.Test/TransposeTest.cs b/MoreLinq.Test/TransposeTest.cs index 2e1cf417d..0394c4a9b 100644 --- a/MoreLinq.Test/TransposeTest.cs +++ b/MoreLinq.Test/TransposeTest.cs @@ -58,7 +58,7 @@ public void TransposeWithRowsOfSameLength() using var row3 = TestingSequence.Of(30, 31, 32, 33); using var matrix = TestingSequence.Of(row1, row2, row3); - AssertMatrix(expectations, matrix.Transpose()); + Assert.That(matrix.Transpose(), Is.EqualTo(expectations)); } [Test] @@ -77,7 +77,7 @@ public void TransposeWithRowsOfDifferentLengths() using var row4 = TestingSequence.Of(30, 31, 32); using var matrix = TestingSequence.Of(row1, row2, row3, row4); - AssertMatrix(expectations, matrix.Transpose()); + Assert.That(matrix.Transpose(), Is.EqualTo(expectations)); } [Test] @@ -116,7 +116,7 @@ public void TransposeWithAllRowsAsInfiniteSequences() [32, 243, 3125] }; - AssertMatrix(expectations, result); + Assert.That(result, Is.EqualTo(expectations)); } [Test] @@ -139,7 +139,7 @@ public void TransposeWithSomeRowsAsInfiniteSequences() [32, 3125] }; - AssertMatrix(expectations, result); + Assert.That(result, Is.EqualTo(expectations)); } [Test] @@ -207,18 +207,5 @@ static bool IsPrime(int number) return true; } - - static void AssertMatrix(IEnumerable> expectation, IEnumerable> result) - { - // necessary because NUnitLite 3.6.1 (.NET 4.5) for Mono don't assert nested enumerables - - var resultList = result.ToList(); - var expectationList = expectation.ToList(); - - Assert.That(resultList.Count, Is.EqualTo(expectationList.Count)); - - expectationList.Zip(resultList, ValueTuple.Create) - .ForEach(t => t.Item1.AssertSequenceEqual(t.Item2)); - } } }