IVersionedLongList<T> interface & RecyclableLongList.GetVersionedEnumerator added for use with foreach.
This commit is contained in:
1 parent
49c0615a62
commit
448656fd29
4 files changed
+32
-4
No files matched your search
@@ -398,6 +398,24 @@ namespace Recyclable.CollectionsTests
|
||||
_ = actual.Should().ContainInConsecutiveOrder(testData);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[MemberData(nameof(RecyclableLongListTestData.SourceTargetDataVariants), MemberType = typeof(RecyclableLongListTestData))]
|
||||
public void VersionedEnumerateShouldYieldAllItemsInCorrectOrder(string testCase, IEnumerable<long> testData, long itemsCount, int targetBlockSize)
|
||||
{
|
||||
// Prepare
|
||||
using var list = new RecyclableLongList<long>(testData, minBlockSize: targetBlockSize);
|
||||
|
||||
// Act
|
||||
var actual = new List<long>();
|
||||
foreach(var item in (IVersionedLongList<long>)list)
|
||||
{
|
||||
actual.Add(item);
|
||||
}
|
||||
|
||||
// Validate
|
||||
_ = actual.Should().ContainInConsecutiveOrder(testData);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void IndexOfShouldNotFindAnythingWhenListEmpty()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user