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_Head_List() //добавить узел в голову списка
        {
            OLS <string> list = new OLS <string>();

            list.Add_in_Tail("Мышкин");
            list.Add_in_Tail("Иванова");
            list.Add_in_Tail("Смирнов");
            list.Add_in_Tail("Кравчук");
            list.Add_in_Head("Петров");
            Assert.AreEqual(list.head.Data, "Петров");
        }
コード例 #3
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, "Петров");
        }
コード例 #4
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;
            }
        }
コード例 #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, "Кузнецова");
        }