public void InitialArrayWithoutExistingItems() { var testTarget = new DoubleArraySizeStrategy <int>(); var array = testTarget.CreateInitialArray(); array.Length.Should().Be(testTarget.InitialCapacity); }
public void IncreaseArraySize(int[] array) { var testTarget = new DoubleArraySizeStrategy <int>(); var newArray = testTarget.CreateLargerArrayFrom(array); newArray.Length.Should().Be(array.Length * 2); newArray.MustStartWith(array); }
public void InitialArrayWithExistingItems(int[] existingItems, int expectedCapacity) { var testTarget = new DoubleArraySizeStrategy <int>(); var array = testTarget.CreateInitialArray(existingItems); array.Length.Should().Be(expectedCapacity); array.MustStartWith(existingItems); }