diff --git a/MoreLinq.Test/AcquireTest.cs b/MoreLinq.Test/AcquireTest.cs index bdbbe2ec8..70c247e15 100644 --- a/MoreLinq.Test/AcquireTest.cs +++ b/MoreLinq.Test/AcquireTest.cs @@ -38,7 +38,7 @@ public void AcquireAll() Assert.That(disposables.Length, Is.EqualTo(3)); - foreach (var disposable in disposables.ZipShortest(new[] { a, b, c }, (act, exp) => new { Actual = act, Expected = exp })) + foreach (var disposable in disposables.ZipShortest([a, b, c], (act, exp) => new { Actual = act, Expected = exp })) { Assert.That(disposable.Actual, Is.SameAs(disposable.Expected)); Assert.That(disposable.Actual.Disposed, Is.False); diff --git a/MoreLinq.Test/Async/MergeTest.cs b/MoreLinq.Test/Async/MergeTest.cs index 874ddf998..a1d59b08c 100644 --- a/MoreLinq.Test/Async/MergeTest.cs +++ b/MoreLinq.Test/Async/MergeTest.cs @@ -72,14 +72,14 @@ public async Task MergeAsyncAll() using var ts = TestingSequence.Of(ts1, ts2, ts3, ts4, ts5); var result = await ts.Merge().ToListAsync(); - Assert.That(result, Is.EquivalentTo(new[] - { + Assert.That(result, Is.EquivalentTo( + [ 10, 20, 21, 30, 31, 32, 40, 41, 42, 43, - 50, 51, 52, 53, 54, - })); + 50, 51, 52, 53, 54 + ])); } sealed class AsyncControl diff --git a/MoreLinq.Test/BatchTest.cs b/MoreLinq.Test/BatchTest.cs index abf306d0f..6fb223b0b 100644 --- a/MoreLinq.Test/BatchTest.cs +++ b/MoreLinq.Test/BatchTest.cs @@ -132,7 +132,7 @@ public void BatchUsesCollectionCountAtIterationTime(SourceKind kind) var result = list.AsSourceKind(kind).Batch(3); list.Add(3); - result.AssertSequenceEqual(new[] { 1, 2, 3 }); + result.AssertSequenceEqual([1, 2, 3]); list.Add(4); // should fail trying to enumerate because count is now greater than the batch size diff --git a/MoreLinq.Test/EquiZipTest.cs b/MoreLinq.Test/EquiZipTest.cs index 523d29ad0..a7cc8b2e8 100644 --- a/MoreLinq.Test/EquiZipTest.cs +++ b/MoreLinq.Test/EquiZipTest.cs @@ -48,7 +48,7 @@ public void BothSequencesDisposedWithUnequalLengthsAndShorterFirst() [Test] public void ZipWithEqualLengthSequencesFailStrategy() { - var zipped = new[] { 1, 2, 3 }.EquiZip(new[] { 4, 5, 6 }, Tuple.Create); + var zipped = new[] { 1, 2, 3 }.EquiZip([4, 5, 6], Tuple.Create); Assert.That(zipped, Is.Not.Null); zipped.AssertSequenceEqual((1, 4), (2, 5), (3, 6)); } @@ -56,7 +56,7 @@ public void ZipWithEqualLengthSequencesFailStrategy() [Test] public void ZipWithFirstSequenceShorterThanSecondFailStrategy() { - var zipped = new[] { 1, 2 }.EquiZip(new[] { 4, 5, 6 }, Tuple.Create); + var zipped = new[] { 1, 2 }.EquiZip([4, 5, 6], Tuple.Create); Assert.That(zipped, Is.Not.Null); Assert.That(zipped.Consume, Throws.InvalidOperationException); } @@ -64,7 +64,7 @@ public void ZipWithFirstSequenceShorterThanSecondFailStrategy() [Test] public void ZipWithFirstSequnceLongerThanSecondFailStrategy() { - var zipped = new[] { 1, 2, 3 }.EquiZip(new[] { 4, 5 }, Tuple.Create); + var zipped = new[] { 1, 2, 3 }.EquiZip([4, 5], Tuple.Create); Assert.That(zipped, Is.Not.Null); Assert.That(zipped.Consume, Throws.InvalidOperationException); } diff --git a/MoreLinq.Test/TakeLastTest.cs b/MoreLinq.Test/TakeLastTest.cs index 2c20f8137..4cc514e9f 100644 --- a/MoreLinq.Test/TakeLastTest.cs +++ b/MoreLinq.Test/TakeLastTest.cs @@ -28,7 +28,7 @@ public class TakeLastTest [Test] public void TakeLast() { - AssertTakeLast(new[] { 12, 34, 56, 78, 910, 1112 }, + AssertTakeLast([12, 34, 56, 78, 910, 1112], 3, result => result.AssertSequenceEqual(78, 910, 1112)); } @@ -36,7 +36,7 @@ public void TakeLast() [Test] public void TakeLastOnSequenceShortOfCount() { - AssertTakeLast(new[] { 12, 34, 56 }, + AssertTakeLast([12, 34, 56], 5, result => result.AssertSequenceEqual(12, 34, 56)); } @@ -44,7 +44,7 @@ public void TakeLastOnSequenceShortOfCount() [Test] public void TakeLastWithNegativeCount() { - AssertTakeLast(new[] { 12, 34, 56 }, + AssertTakeLast([12, 34, 56], -2, result => Assert.That(result, Is.Empty)); } diff --git a/MoreLinq.Test/ZipShortestTest.cs b/MoreLinq.Test/ZipShortestTest.cs index 5c0d1a75e..fc6dde77b 100644 --- a/MoreLinq.Test/ZipShortestTest.cs +++ b/MoreLinq.Test/ZipShortestTest.cs @@ -44,7 +44,7 @@ public void BothSequencesDisposedWithUnequalLengthsAndShorterFirst() [Test] public void ZipShortestWithEqualLengthSequences() { - var zipped = new[] { 1, 2, 3 }.ZipShortest(new[] { 4, 5, 6 }, Tuple.Create); + var zipped = new[] { 1, 2, 3 }.ZipShortest([4, 5, 6], Tuple.Create); Assert.That(zipped, Is.Not.Null); zipped.AssertSequenceEqual((1, 4), (2, 5), (3, 6)); } @@ -52,7 +52,7 @@ public void ZipShortestWithEqualLengthSequences() [Test] public void ZipShortestWithFirstSequenceShorterThanSecond() { - var zipped = new[] { 1, 2 }.ZipShortest(new[] { 4, 5, 6 }, Tuple.Create); + var zipped = new[] { 1, 2 }.ZipShortest([4, 5, 6], Tuple.Create); Assert.That(zipped, Is.Not.Null); zipped.AssertSequenceEqual((1, 4), (2, 5)); } @@ -60,7 +60,7 @@ public void ZipShortestWithFirstSequenceShorterThanSecond() [Test] public void ZipShortestWithFirstSequnceLongerThanSecond() { - var zipped = new[] { 1, 2, 3 }.ZipShortest(new[] { 4, 5 }, Tuple.Create); + var zipped = new[] { 1, 2, 3 }.ZipShortest([4, 5], Tuple.Create); Assert.That(zipped, Is.Not.Null); zipped.AssertSequenceEqual((1, 4), (2, 5)); }