From eaf5ced5a0399acaa76a06353d65fd5c6256a155 Mon Sep 17 00:00:00 2001 From: Atif Aziz Date: Sun, 18 Dec 2022 18:22:44 +0100 Subject: [PATCH] Use method groups --- MoreLinq.Test/EquiZipTest.cs | 6 ++---- MoreLinq.Test/MemoizeTest.cs | 3 +-- MoreLinq.Test/SubsetTest.cs | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/MoreLinq.Test/EquiZipTest.cs b/MoreLinq.Test/EquiZipTest.cs index bd0be72d2..c0d18b0af 100644 --- a/MoreLinq.Test/EquiZipTest.cs +++ b/MoreLinq.Test/EquiZipTest.cs @@ -60,8 +60,7 @@ public void ZipWithFirstSequenceShorterThanSecondFailStrategy() { var zipped = new[] { 1, 2 }.EquiZip(new[] { 4, 5, 6 }, Tuple.Create); Assert.That(zipped, Is.Not.Null); - Assert.That(() => zipped.Consume(), - Throws.InvalidOperationException); + Assert.That(zipped.Consume, Throws.InvalidOperationException); } [Test] @@ -69,8 +68,7 @@ public void ZipWithFirstSequnceLongerThanSecondFailStrategy() { var zipped = new[] { 1, 2, 3 }.EquiZip(new[] { 4, 5 }, Tuple.Create); Assert.That(zipped, Is.Not.Null); - Assert.That(() => zipped.Consume(), - Throws.InvalidOperationException); + Assert.That(zipped.Consume, Throws.InvalidOperationException); } [Test] diff --git a/MoreLinq.Test/MemoizeTest.cs b/MoreLinq.Test/MemoizeTest.cs index da11bc7f3..2d94bdf42 100644 --- a/MoreLinq.Test/MemoizeTest.cs +++ b/MoreLinq.Test/MemoizeTest.cs @@ -310,8 +310,7 @@ public void MemoizeRethrowsErrorDuringFirstIterationStartToAllIterationsUntilDis var memo = source.Memoize(); for (var i = 0; i < 2; i++) - Assert.That(() => memo.First(), - Throws.TypeOf().And.SameAs(error)); + Assert.That(memo.First, Throws.TypeOf().And.SameAs(error)); ((IDisposable) memo).Dispose(); Assert.That(memo.Single(), Is.EqualTo(obj)); diff --git a/MoreLinq.Test/SubsetTest.cs b/MoreLinq.Test/SubsetTest.cs index 51e648554..e08174ef8 100644 --- a/MoreLinq.Test/SubsetTest.cs +++ b/MoreLinq.Test/SubsetTest.cs @@ -59,7 +59,7 @@ public void TestSubsetLargerThanSequence() var sequence = Enumerable.Range(1, count); var result = sequence.Subsets(count + 5); - Assert.That(() => result.Consume(), // this particular exception is deferred until sequence evaluation + Assert.That(result.Consume, // this particular exception is deferred until sequence evaluation Throws.ArgumentOutOfRangeException("subsetSize")); }