diff --git a/Recyclable.CollectionsTests/RecyclableListTests.cs b/Recyclable.CollectionsTests/RecyclableListTests.cs index f01a884..54f6477 100644 --- a/Recyclable.CollectionsTests/RecyclableListTests.cs +++ b/Recyclable.CollectionsTests/RecyclableListTests.cs @@ -48,7 +48,7 @@ namespace Recyclable.CollectionsTests // Validate _ = list.Capacity.Should().BeGreaterThanOrEqualTo((int)itemsCount, "when capacity == 0, then we should allocate as much memory as needed, only"); _ = list.Count.Should().Be((int)itemsCount); - _ = list.Should().ContainInConsecutiveOrder(testData); + _ = list.Should().Equal(testData); } [Theory] @@ -146,7 +146,7 @@ namespace Recyclable.CollectionsTests } _ = list.Count.Should().Be(expectedData.Count); - _ = list.Should().ContainInConsecutiveOrder(expectedData); + _ = list.Should().Equal(expectedData); } [Theory] @@ -165,7 +165,7 @@ namespace Recyclable.CollectionsTests // Validate _ = list.Count.Should().Be((int)(itemsCount * 2)); - _ = list.Should().ContainInConsecutiveOrder(testData); + _ = list.Should().Equal(testData); } [Theory] @@ -185,7 +185,7 @@ namespace Recyclable.CollectionsTests // Validate _ = list.Capacity.Should().BeGreaterThanOrEqualTo((int)itemsCount); _ = list.Count.Should().Be((int)itemsCount); - _ = list.Should().ContainInConsecutiveOrder(testData); + _ = list.Should().Equal(testData); } [Theory] @@ -202,7 +202,7 @@ namespace Recyclable.CollectionsTests // Validate _ = list.Count.Should().Be((int)(itemsCount * 2)); - _ = list.Should().ContainInConsecutiveOrder(testData.Concat(testData)); + _ = list.Should().Equal(testData.Concat(testData)); } [Theory] @@ -243,7 +243,7 @@ namespace Recyclable.CollectionsTests // Validate _ = list.Count.Should().Be((int)itemsCount * 2); - _ = list.Should().ContainInConsecutiveOrder(testData.Concat(testData)); + _ = list.Should().Equal(testData.Concat(testData)); } [Theory] @@ -256,7 +256,7 @@ namespace Recyclable.CollectionsTests // Validate _ = list.Capacity.Should().BeGreaterThanOrEqualTo((int)itemsCount, "when we succeed in taking count without enumerating, then we allocate as much memory as needed, only"); _ = list.Count.Should().Be((int)itemsCount); - _ = list.Should().ContainInConsecutiveOrder(testData); + _ = list.Should().Equal(testData); } [Theory] @@ -268,7 +268,7 @@ namespace Recyclable.CollectionsTests // Validate _ = list.Count.Should().Be((int)itemsCount); - _ = list.Should().ContainInConsecutiveOrder(testData); + _ = list.Should().Equal(testData); } [Theory] @@ -339,7 +339,7 @@ namespace Recyclable.CollectionsTests list.CopyTo(copiedItems, 0); // Validate - _ = copiedItems.Should().ContainInConsecutiveOrder(testData); + _ = copiedItems.Should().Equal(testData); } [Theory] @@ -359,7 +359,7 @@ namespace Recyclable.CollectionsTests // Validate _ = yieldedItems.Count.Should().Be((int)itemsCount); - _ = yieldedItems.Should().ContainInConsecutiveOrder(testData); + _ = yieldedItems.Should().Equal(testData); } [Fact] @@ -443,7 +443,7 @@ namespace Recyclable.CollectionsTests // Validate _ = list.Count.Should().Be((int)itemsCount); - _ = list.Should().ContainInConsecutiveOrder(testData); + _ = list.Should().Equal(testData); // Act foreach (var item in testData.Reverse()) @@ -469,7 +469,7 @@ namespace Recyclable.CollectionsTests // Validate _ = list.Capacity.Should().BeGreaterThanOrEqualTo((int)itemsCount); _ = list.Count.Should().Be((int)itemsCount); - _ = list.Should().ContainInConsecutiveOrder(testData.Reverse()); + _ = list.Should().Equal(testData.Reverse()); } [Theory] @@ -502,7 +502,7 @@ namespace Recyclable.CollectionsTests // Validate _ = list.Count.Should().Be((int)(itemsCount - deleted)); - _ = list.Should().ContainInConsecutiveOrder(testData.Skip(deleted)); + _ = list.Should().Equal(testData.Skip(deleted)); } _ = list.Should().BeEmpty(); @@ -524,7 +524,7 @@ namespace Recyclable.CollectionsTests // Validate _ = list.Count.Should().Be((int)(itemsCount - deleted)); - _ = list.Should().ContainInConsecutiveOrder(testData.Take((int)(itemsCount - deleted))); + _ = list.Should().Equal(testData.Take((int)(itemsCount - deleted))); } _ = list.Should().BeEmpty(); @@ -546,7 +546,7 @@ namespace Recyclable.CollectionsTests // Validate _ = list.Count.Should().Be((int)(itemsCount - deleted)); - _ = list.Should().ContainInConsecutiveOrder(testData.Skip(deleted)); + _ = list.Should().Equal(testData.Skip(deleted)); } } @@ -565,7 +565,7 @@ namespace Recyclable.CollectionsTests // Validate _ = list.Count.Should().Be((int)(itemsCount - deleted)); - _ = list.Should().ContainInConsecutiveOrder(testData.Take((int)(itemsCount - deleted))); + _ = list.Should().Equal(testData.Take((int)(itemsCount - deleted))); } } @@ -584,7 +584,7 @@ namespace Recyclable.CollectionsTests } // Validate - _ = yieldedItems.Should().ContainInConsecutiveOrder(testData); + _ = yieldedItems.Should().Equal(testData); } } } \ No newline at end of file diff --git a/Recyclable.CollectionsTests/RecyclableLongListTests.cs b/Recyclable.CollectionsTests/RecyclableLongListTests.cs index 87ae9ce..200e53f 100644 --- a/Recyclable.CollectionsTests/RecyclableLongListTests.cs +++ b/Recyclable.CollectionsTests/RecyclableLongListTests.cs @@ -50,7 +50,7 @@ namespace Recyclable.CollectionsTests _ = list.Capacity.Should().BeGreaterThanOrEqualTo(expectedItemsCount, "when capacity == 0, then we should allocate as much memory as needed, only"); _ = list.LastBlockWithData.Should().Be((int)(itemsCount / list.BlockSize) - (itemsCount % list.BlockSize != 0 ? 0 : 1)); _ = list.LongCount.Should().Be(expectedItemsCount); - _ = list.Should().ContainInConsecutiveOrder(testData); + _ = list.Should().Equal(testData); } [Theory] @@ -150,7 +150,7 @@ namespace Recyclable.CollectionsTests _ = list.LongCount.Should().Be(expectedData.Length); _ = list.LastBlockWithData.Should().Be((int)(itemsCount * 2 / list.BlockSize) - (itemsCount * 2 % list.BlockSize != 0 ? 0 : 1)); - _ = list.Should().ContainInConsecutiveOrder(expectedData); + _ = list.Should().Equal(expectedData); } [Theory] @@ -170,7 +170,7 @@ namespace Recyclable.CollectionsTests // Validate _ = list.LongCount.Should().Be(itemsCount * 2); _ = list.LastBlockWithData.Should().Be((int)(itemsCount * 2 / list.BlockSize) - (itemsCount * 2 % list.BlockSize != 0 ? 0 : 1)); - _ = list.Should().ContainInConsecutiveOrder(testData); + _ = list.Should().Equal(testData); } [Theory] @@ -189,7 +189,7 @@ namespace Recyclable.CollectionsTests // Validate _ = list.LongCount.Should().Be(itemsCount, "we added so many items"); _ = list.LastBlockWithData.Should().Be((int)(itemsCount / list.BlockSize) - (itemsCount % list.BlockSize == 0 ? 1 : 0)); - _ = list.Should().ContainInConsecutiveOrder(testData); + _ = list.Should().Equal(testData); } [Theory] @@ -222,7 +222,7 @@ namespace Recyclable.CollectionsTests // Validate _ = list.LongCount.Should().Be(itemsCount * 2); _ = list.LastBlockWithData.Should().Be((int)(itemsCount * 2 / list.BlockSize) - (itemsCount * 2 % list.BlockSize != 0 ? 0 : 1)); - _ = list.Should().ContainInConsecutiveOrder(testData.Concat(testData)); + _ = list.Should().Equal(testData.Concat(testData)); } [Theory] @@ -279,7 +279,7 @@ namespace Recyclable.CollectionsTests // Validate _ = list.Capacity.Should().BeGreaterThanOrEqualTo((int)itemsCount, "when we succeed in taking count without enumerating, then we allocate as much memory as needed, only"); _ = list.LongCount.Should().Be(itemsCount); - _ = list.Should().ContainInConsecutiveOrder(testData); + _ = list.Should().Equal(testData); } [Theory] @@ -291,7 +291,7 @@ namespace Recyclable.CollectionsTests // Validate _ = list.LongCount.Should().Be(itemsCount); - _ = list.Should().ContainInConsecutiveOrder(testData); + _ = list.Should().Equal(testData); } [Theory] @@ -364,7 +364,7 @@ namespace Recyclable.CollectionsTests // Act var actual = new long[itemsCount]; list.CopyTo(actual, 0); - _ = actual.Should().ContainInConsecutiveOrder(testData); + _ = actual.Should().Equal(testData); } [Theory] @@ -398,7 +398,7 @@ namespace Recyclable.CollectionsTests } // Validate - _ = actual.Should().ContainInConsecutiveOrder(testData); + _ = actual.Should().Equal(testData); } [Theory] @@ -416,7 +416,7 @@ namespace Recyclable.CollectionsTests } // Validate - _ = actual.Should().ContainInConsecutiveOrder(testData); + _ = actual.Should().Equal(testData); } [Fact] @@ -500,7 +500,7 @@ namespace Recyclable.CollectionsTests // Validate _ = list.LongCount.Should().Be(itemsCount); - _ = list.Should().ContainInConsecutiveOrder(testData); + _ = list.Should().Equal(testData); // Act foreach (var item in testData.Reverse()) @@ -526,7 +526,7 @@ namespace Recyclable.CollectionsTests // Validate _ = list.Capacity.Should().BeGreaterThanOrEqualTo((int)itemsCount); _ = list.Count.Should().Be((int)itemsCount); - _ = list.Should().ContainInConsecutiveOrder(testData.Reverse()); + _ = list.Should().Equal(testData.Reverse()); } [Theory] @@ -615,7 +615,7 @@ namespace Recyclable.CollectionsTests // Validate _ = list.Count.Should().Be((int)(itemsCount - deleted)); _ = list.LastBlockWithData.Should().Be((int)(list.LongCount >> list.BlockSizePow2BitShift) - ((list.LongCount & list.BlockSizeMinus1) != 0 ? 0 : 1)); - _ = list.Should().ContainInConsecutiveOrder(listAsArray[deleted..]); + _ = list.Should().Equal(listAsArray[deleted..]); } _ = list.Should().BeEmpty(); @@ -640,7 +640,7 @@ namespace Recyclable.CollectionsTests // Validate _ = list.Count.Should().Be((int)(itemsCount - deleted)); _ = list.LastBlockWithData.Should().Be((int)(list.LongCount >> list.BlockSizePow2BitShift) - ((list.LongCount & list.BlockSizeMinus1) != 0 ? 0 : 1)); - _ = list.Should().ContainInConsecutiveOrder(listAsArray[..(int)(itemsCount - deleted)]); + _ = list.Should().Equal(listAsArray[..(int)(itemsCount - deleted)]); } _ = list.Should().BeEmpty(); @@ -665,7 +665,7 @@ namespace Recyclable.CollectionsTests // Validate _ = list.Count.Should().Be((int)(itemsCount - deleted)); _ = list.LastBlockWithData.Should().Be((int)(list.LongCount >> list.BlockSizePow2BitShift) - ((list.LongCount & list.BlockSizeMinus1) != 0 ? 0 : 1)); - _ = list.Should().ContainInConsecutiveOrder(listAsArray[deleted..]); + _ = list.Should().Equal(listAsArray[deleted..]); } _ = list.Should().BeEmpty(); @@ -689,7 +689,7 @@ namespace Recyclable.CollectionsTests var expectedList = listAsArray[..((int)itemsCount - removedCount)]; _ = list.LastBlockWithData.Should().Be((int)(list.LongCount >> list.BlockSizePow2BitShift) - ((list.LongCount & list.BlockSizeMinus1) != 0 ? 0 : 1)); _ = list.LongCount.Should().Be(expectedList.Length); - _ = list.Should().ContainInConsecutiveOrder(expectedList); + _ = list.Should().Equal(expectedList); } _ = list.Should().BeEmpty();