From 56ca83d128740f4723f3d33bfb5f49582ceda913 Mon Sep 17 00:00:00 2001 From: mlemanczyk Date: Sun, 16 Jul 2023 12:15:35 +0200 Subject: [PATCH] .ToArray() calls removed or converted to recyclable types. --- Recyclable.CollectionsTests/RecyclableListTests.cs | 6 +++--- .../RecyclableLongListTestData.cs | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Recyclable.CollectionsTests/RecyclableListTests.cs b/Recyclable.CollectionsTests/RecyclableListTests.cs index 7f38864..30555f1 100644 --- a/Recyclable.CollectionsTests/RecyclableListTests.cs +++ b/Recyclable.CollectionsTests/RecyclableListTests.cs @@ -137,14 +137,14 @@ namespace Recyclable.CollectionsTests } // Validate - var expectedData = testData.Concat(testData).ToArray(); + var expectedData = testData.Concat(testData).ToRecyclableLongList(); if (itemsCount > 0) { _ = list.Capacity.Should().BeGreaterThanOrEqualTo((int)itemsCount * 2); } - _ = list.Count.Should().Be(expectedData.Length); + _ = list.Count.Should().Be(expectedData.Count); _ = list.Should().ContainInConsecutiveOrder(expectedData); } @@ -153,7 +153,7 @@ namespace Recyclable.CollectionsTests public void AddShouldAcceptDuplicates(string testCase, IEnumerable testData, long itemsCount) { // Prepare - testData = testData.Concat(testData).ToArray(); + testData = testData.Concat(testData).ToRecyclableLongList(); // Act using var list = new RecyclableList(); diff --git a/Recyclable.CollectionsTests/RecyclableLongListTestData.cs b/Recyclable.CollectionsTests/RecyclableLongListTestData.cs index bffd458..bf4d8b9 100644 --- a/Recyclable.CollectionsTests/RecyclableLongListTestData.cs +++ b/Recyclable.CollectionsTests/RecyclableLongListTestData.cs @@ -12,7 +12,7 @@ namespace Recyclable.CollectionsTests } } - public static IEnumerable CreateTestData(long itemsCount) => DoCreateTestData(itemsCount).ToArray(); + public static IEnumerable CreateTestData(long itemsCount) => DoCreateTestData(itemsCount); public static readonly IEnumerable ItemsCountVariants = new long[] { @@ -37,7 +37,7 @@ namespace Recyclable.CollectionsTests } } - public static IEnumerable TargetDataVariants => GetTargetDataVariants().ToArray(); + public static IEnumerable TargetDataVariants => GetTargetDataVariants(); private static IEnumerable CreateSourceDataVariants() { @@ -62,7 +62,7 @@ namespace Recyclable.CollectionsTests } } - public static IEnumerable SourceDataVariants => CreateSourceDataVariants().ToArray(); + public static IEnumerable SourceDataVariants => CreateSourceDataVariants(); private static IEnumerable CreateSourceEmptyDataVariants() => new[] { @@ -75,7 +75,7 @@ namespace Recyclable.CollectionsTests new object[] { "IEnumerable without non-enumerated count", new EnumerableWithoutCount(Array.Empty()) } }; - public static IEnumerable EmptySourceDataVariants => CreateSourceEmptyDataVariants().ToArray(); + public static IEnumerable EmptySourceDataVariants => CreateSourceEmptyDataVariants(); private static IEnumerable CreateSourceTargetDataVariants() { @@ -88,6 +88,6 @@ namespace Recyclable.CollectionsTests } } - public static IEnumerable SourceTargetDataVariants => CreateSourceTargetDataVariants().ToArray(); + public static IEnumerable SourceTargetDataVariants => CreateSourceTargetDataVariants(); } } \ No newline at end of file