コード例 #1
0
        public void Delete_Exception(int[] data, int toDelete)
        {
            var ll = new CrackingTheCodingInterview.DataStructures.LinkedLists.DoublyLinkedList <int>();

            foreach (var item in data)
            {
                ll.Add(item);
            }

            ll.Delete(toDelete);
        }
コード例 #2
0
        public void Delete(int[] data, int toDelete, int[] expected)
        {
            var ll = new CrackingTheCodingInterview.DataStructures.LinkedLists.DoublyLinkedList <int>();

            foreach (var item in data)
            {
                ll.Add(item);
            }

            ll.Delete(toDelete);

            Assert.AreEqual(expected.Length, ll.Count);
            for (int i = 0; i < expected.Length; i++)
            {
                Assert.AreEqual(expected[i], ll[i].value);
            }
        }