Exemplo n.º 1
0
        public static void ClearTest()
        {
            var array = new UnmanagedArray <int>(3);

            array[0] = 1;
            array[1] = 2;
            array[2] = 3;

            using (var valueList = new UnmanagedValueList <int>(array, takeOwnership: true))
            {
                valueList.Clear();

                Assert.That(() => valueList,
                            Has.Property("Capacity").EqualTo((nuint)3)
                            .And.Count.EqualTo((nuint)0)
                            );
            }

            using (var valueList = new UnmanagedValueList <int>())
            {
                valueList.Clear();

                Assert.That(() => valueList,
                            Has.Property("Capacity").EqualTo((nuint)0)
                            .And.Count.EqualTo((nuint)0)
                            );
            }
        }
Exemplo n.º 2
0
 /// <summary>Removes all items from the pool.</summary>
 public void Clear()
 {
     _items.Clear();
     _availableItems.Clear();
 }