コード例 #1
0
        public void SizeToCapacityClearModeAlways()
        {
            var items = GenericArrayFactory(13);
            var value = CreateT(42);

            items[7] = value;
            items[items.Length - 1] = value;
            var pool = new SingleArrayPool(items);

            var list = new PooledList <T>(13, ClearMode.Always, pool, true);

            Assert.Equal(default, list[7]);
コード例 #2
0
        public void SizeToCapacityClearModeNever()
        {
            var items = GenericArrayFactory(13);
            var value = CreateT(42);

            items[7] = value;
            var pool = new SingleArrayPool(items);

            var list = new PooledList <T>(13, ClearMode.Never, pool, true);

            Assert.Equal(value, list[7]);

            list.Dispose();
        }