Beispiel #1
0
        public void DeleteNElementsFromNegativTest(int[] array, int idx, int number, string excepyion)
        {
            DLinkedList actual = new DLinkedList(array);

            switch (excepyion)
            {
            case "Index":
                Assert.Throws <IndexOutOfRangeException>(() => actual.DeleteFrom(idx, number));
                break;

            case "Argument":
                Assert.Throws <ArgumentOutOfRangeException>(() => actual.DeleteFrom(idx, number));
                break;
            }
        }
Beispiel #2
0
        public void DeleteFromTest(int[] array, int idx, int[] expectedArray)
        {
            DLinkedList actual   = new DLinkedList(array);
            DLinkedList expected = new DLinkedList(expectedArray);

            actual.DeleteFrom(idx);
            Assert.AreEqual(expected, actual);
        }
Beispiel #3
0
        public void DeleteFromNegativeTest(int[] array, int idx)
        {
            DLinkedList actual = new DLinkedList(array);

            Assert.Throws <IndexOutOfRangeException>(() => actual.DeleteFrom(idx));
        }