public void ДопустимДобавляюВНегоЭлементы()
 {
     list.Add_in_Tail("Смирнов");
     list.Add_in_Head("Петров");
     list.Add_in_Head("Иванов");
     list.Add_in_Head("Васичкин");
 }
예제 #2
0
        public void Insert_Node_in_Tail_List() //добавить узел в хвост списка
        {
            OLS <string> list = new OLS <string>();

            list.Add_in_Head("Мышкин");
            list.Add_in_Head("Иванова");
            list.Add_in_Head("Смирнов");
            list.Add_in_Tail("Кравчук");
            list.Add_in_Head("Петров");
            Assert.AreEqual(list.tail.Data, "Кравчук");
        }
예제 #3
0
        public void Remove_the_Entire_List() //удалить весь список
        {
            OLS <string> list = new OLS <string>();

            list.Add_in_Tail("Смирнов");
            list.Add_in_Head("Петров");
            list.Add_in_Head("Иванов");
            list.Add_in_Head("Васичкин");
            list.Clear();

            OLS <string> .Node <string> current = list.head;
            while (current != null)
            {
                Assert.AreEqual(current.Data, null);
                current = current.Next;
            }
        }
예제 #4
0
        public void Insert_Two_Node()
        {
            OLS <string> list = new OLS <string>();

            list.Add_in_Tail("Смирнов");
            list.Add_in_Head("Петров");
            Assert.AreEqual(list.tail.Data, "Смирнов");
            Assert.AreEqual(list.head.Data, "Петров");
        }
예제 #5
0
        public void Remove_Specified_Node() // удалить заданный узел
        {
            OLS <string> list = new OLS <string>();

            list.Add_in_Tail("Смирнов");
            list.Add_in_Head("Петров");
            list.Add_in_Head("Иванов");
            list.Add_in_Head("Васичкин");
            list.Remove("Петров");

            Assert.AreEqual(list.count, 3);

            OLS <string> .Node <string> current = list.head;
            while (current != null)
            {
                Assert.AreNotEqual(current.Data, "Петров");
                current = current.Next;
            }
        }
예제 #6
0
        public void Insert_Node_last_Specified_Node() // добавить узел после заданного узла
        {
            OLS <string> list = new OLS <string>();

            list.Add_in_Tail("Смирнов");
            list.Add_in_Head("Петров");
            list.Add_in_Head("Иванов");
            list.Add_in_Head("Васичкин");
            list.Add("Кузнецова", "Иванов");

            OLS <string> .Node <string> current = list.head;
            int i = 0;

            while (i != 3)
            {
                current = current.Next;
                i++;
            }
            Assert.AreNotEqual(current.Data, "Кузнецова");
        }
예제 #7
0
        public void Insert_Node()
        {
            OLS <string> list = new OLS <string>();

            list.Add_in_Tail("Смирнов");
            list.Add_in_Head("Петров");
            list.Add_in_Head("Иванов");
            list.Add_in_Head("Васичкин");
            list.Add("Кузнецова", "Иванов");

            OLS <string> .Node <string> current = list.head;
            int i = 0;

            while (i != 3)
            {
                current = current.Next;
                i++;
            }
            Assert.AreNotEqual(current.Data, "Кузнецова");
        }