RecyclableArrayList.AddRange(IEnumerable<T>) performance improvements. ...WhenSourceIsIEnumerable benchmarks reworked to use real IEnumerable, which can't be typecasted to anything.
This commit is contained in:
1 parent
bf2d966f28
commit
f500f846ac
7 files changed
+121
-33
No files matched your search
@@ -62,6 +62,22 @@ namespace Recyclable.CollectionsTests
|
||||
.And.BeEquivalentTo(testData);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ConstructorShouldAddItemsInCorrectOrderWhenSourceIsIEnumerable()
|
||||
{
|
||||
// Prepare
|
||||
var testData = _testData;
|
||||
|
||||
// Act
|
||||
var list = new RecyclableArrayList<int>(testData);
|
||||
|
||||
// Validate
|
||||
_ = list.Capacity.Should().Be(32, "when we succeed in taking count without enumerating, then we allocate as much memory as needed, only");
|
||||
_ = list.Should().HaveCount(testData.Count())
|
||||
.And.ContainInConsecutiveOrder(testData)
|
||||
.And.BeEquivalentTo(testData);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void InsertAtTheBeginningShouldMoveItems()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user