RecyclableList.InsertAt test added.

This commit is contained in:
Memek committed 2023-02-07 20:18:58 +01:00
1 parent 32d915087f
commit a37f572518
1 file changed
+12 -1
@@ -256,7 +256,7 @@ namespace Recyclable.CollectionsTests
list.AddRange(testData);
// Validate
_ = list.Capacity.Should().Be(16384,"when capacity == 0, then we allocate as much memory as needed, only");
_ = list.Capacity.Should().Be(16384, "when capacity == 0, then we allocate as much memory as needed, only");
_ = list.Should().HaveCount(testData.Length)
.And.ContainInConsecutiveOrder(testData)
.And.BeEquivalentTo(testData);
@@ -278,5 +278,16 @@ namespace Recyclable.CollectionsTests
.And.ContainInConsecutiveOrder(testData)
.And.BeEquivalentTo(testData);
}
[Fact]
public void InsertAtTheBeginningShouldMoveItems()
{
// Prepare
var testData = _testData.ToArray();
var list = new RecyclableList<int>();
// Act
_ = Assert.Throws<NotSupportedException>(() => list.Insert(0, -1));
}
}
}