Skip to content

Commit

Permalink
Use method groups
Browse files Browse the repository at this point in the history
  • Loading branch information
atifaziz committed Dec 18, 2022
1 parent a51b07a commit eaf5ced
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
6 changes: 2 additions & 4 deletions MoreLinq.Test/EquiZipTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,15 @@ 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]
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]
Expand Down
3 changes: 1 addition & 2 deletions MoreLinq.Test/MemoizeTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,7 @@ public void MemoizeRethrowsErrorDuringFirstIterationStartToAllIterationsUntilDis
var memo = source.Memoize();

for (var i = 0; i < 2; i++)
Assert.That(() => memo.First(),
Throws.TypeOf<Exception>().And.SameAs(error));
Assert.That(memo.First, Throws.TypeOf<Exception>().And.SameAs(error));

((IDisposable) memo).Dispose();
Assert.That(memo.Single(), Is.EqualTo(obj));
Expand Down
2 changes: 1 addition & 1 deletion MoreLinq.Test/SubsetTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}

Expand Down

0 comments on commit eaf5ced

Please sign in to comment.