public void ДопустимДобавляюВНегоЭлементы() { list.Add_in_Tail("Смирнов"); list.Add_in_Head("Петров"); list.Add_in_Head("Иванов"); list.Add_in_Head("Васичкин"); }
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, "Петров"); }
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, "Петров"); }
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; } }
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; } }
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, "Кузнецова"); }
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, "Кузнецова"); }