Esempio n. 1
0
        public void InitialArrayWithoutExistingItems()
        {
            var testTarget = new DoubleArraySizeStrategy <int>();

            var array = testTarget.CreateInitialArray();

            array.Length.Should().Be(testTarget.InitialCapacity);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }