コード例 #1
0
        public void should_expand_automatically_when_needed()
        {
            var expansionIterations = 20;
            var expansionSize       = 10;
            var initialSize         = 10;

            var componentPool = new ComponentPool <TestComponentOne>(expansionSize, initialSize);
            var newSize       = initialSize;

            for (var i = 0; i < expansionIterations; i++)
            {
                componentPool.Expand();
                newSize += expansionSize;

                Assert.Equal(componentPool.Count, newSize);
                Assert.Equal(componentPool.Components.Length, newSize);
            }
        }