Beispiel #1
0
        /// <summary>
        /// Test removing an item from an empty array
        /// </summary>
        static void TestRemoveEmptyDynamicArray()
        {
            OrderedDynamicArray <String> array = new OrderedDynamicArray <String>();

            System.Console.Write("TestRemoveEmptyDynamicArray: ");
            if (!array.Remove("Foxtrot"))
            {
                System.Console.WriteLine("Passed");
            }
            else
            {
                System.Console.WriteLine("FAILED!!! Expected: false Actual: true");
            }
        }
Beispiel #2
0
        /// <summary>
        /// Test removing an item in the interior of the array
        /// </summary>
        static void TestRemoveItemInteriorOfDynamicArray()
        {
            OrderedDynamicArray <String> array = new OrderedDynamicArray <String>();

            array.Add("Delta");
            array.Add("Echo");
            array.Add("Foxtrot");
            System.Console.Write("TestRemoveItemInteriorOfDynamicArray: ");
            bool   removed     = array.Remove("Echo");
            String arrayString = array.ToString();

            if (removed &&
                arrayString.Equals("Delta,Foxtrot") &&
                array.Count == 2)
            {
                System.Console.WriteLine("Passed");
            }
            else
            {
                System.Console.WriteLine("FAILED!!! Expected: Delta,Foxtrot Actual: " + arrayString);
            }
        }