.ToArray() calls removed or converted to recyclable types.

This commit is contained in:
mlemanczyk committed 2023-07-16 12:15:35 +02:00
1 parent 10189d0d11
commit 56ca83d128
2 files changed
+8 -8

No files matched your search

@@ -137,14 +137,14 @@ namespace Recyclable.CollectionsTests
} }
// Validate // Validate
var expectedData = testData.Concat(testData).ToArray(); var expectedData = testData.Concat(testData).ToRecyclableLongList();
if (itemsCount > 0) if (itemsCount > 0)
{ {
_ = list.Capacity.Should().BeGreaterThanOrEqualTo((int)itemsCount * 2); _ = list.Capacity.Should().BeGreaterThanOrEqualTo((int)itemsCount * 2);
} }
_ = list.Count.Should().Be(expectedData.Length); _ = list.Count.Should().Be(expectedData.Count);
_ = list.Should().ContainInConsecutiveOrder(expectedData); _ = list.Should().ContainInConsecutiveOrder(expectedData);
} }
@@ -153,7 +153,7 @@ namespace Recyclable.CollectionsTests
public void AddShouldAcceptDuplicates(string testCase, IEnumerable<long> testData, long itemsCount) public void AddShouldAcceptDuplicates(string testCase, IEnumerable<long> testData, long itemsCount)
{ {
// Prepare // Prepare
testData = testData.Concat(testData).ToArray(); testData = testData.Concat(testData).ToRecyclableLongList();
// Act // Act
using var list = new RecyclableList<long>(); using var list = new RecyclableList<long>();
@@ -12,7 +12,7 @@ namespace Recyclable.CollectionsTests
} }
} }
public static IEnumerable<long> CreateTestData(long itemsCount) => DoCreateTestData(itemsCount).ToArray(); public static IEnumerable<long> CreateTestData(long itemsCount) => DoCreateTestData(itemsCount);
public static readonly IEnumerable<long> ItemsCountVariants = new long[] public static readonly IEnumerable<long> ItemsCountVariants = new long[]
{ {
@@ -37,7 +37,7 @@ namespace Recyclable.CollectionsTests
} }
} }
public static IEnumerable<object[]> TargetDataVariants => GetTargetDataVariants().ToArray(); public static IEnumerable<object[]> TargetDataVariants => GetTargetDataVariants();
private static IEnumerable<object[]> CreateSourceDataVariants() private static IEnumerable<object[]> CreateSourceDataVariants()
{ {
@@ -62,7 +62,7 @@ namespace Recyclable.CollectionsTests
} }
} }
public static IEnumerable<object[]> SourceDataVariants => CreateSourceDataVariants().ToArray(); public static IEnumerable<object[]> SourceDataVariants => CreateSourceDataVariants();
private static IEnumerable<object[]> CreateSourceEmptyDataVariants() => new[] private static IEnumerable<object[]> CreateSourceEmptyDataVariants() => new[]
{ {
@@ -75,7 +75,7 @@ namespace Recyclable.CollectionsTests
new object[] { "IEnumerable<int> without non-enumerated count", new EnumerableWithoutCount<long>(Array.Empty<long>()) } new object[] { "IEnumerable<int> without non-enumerated count", new EnumerableWithoutCount<long>(Array.Empty<long>()) }
}; };
public static IEnumerable<object[]> EmptySourceDataVariants => CreateSourceEmptyDataVariants().ToArray(); public static IEnumerable<object[]> EmptySourceDataVariants => CreateSourceEmptyDataVariants();
private static IEnumerable<object[]> CreateSourceTargetDataVariants() private static IEnumerable<object[]> CreateSourceTargetDataVariants()
{ {
@@ -88,6 +88,6 @@ namespace Recyclable.CollectionsTests
} }
} }
public static IEnumerable<object[]> SourceTargetDataVariants => CreateSourceTargetDataVariants().ToArray(); public static IEnumerable<object[]> SourceTargetDataVariants => CreateSourceTargetDataVariants();
} }
} }