Example #1
0
 public void DeleteBadTest()
 {
     List<int> list = new List<int>();
     list.AddToHead(10);
     list.AddToHead(9);
     list.Delete(4);
 }
Example #2
0
 public void DeleteGoodTest()
 {
     List<int> list = new List<int>();
     list.AddToHead(10);
     list.AddToHead(9);
     list.Delete(0);
     Assert.IsTrue(list.ReturnByIndex(0) == 10);
 }
Example #3
0
 public void ClearTest()
 {
     List<int> list = new List<int>();
     list.AddToHead(10);
     list.Clear();
     Assert.IsTrue(list.Size() == 0);
 }
Example #4
0
 public void InsertGoodTest()
 {
     List<int> list = new List<int>();
     list.AddToHead(5);
     list.AddToHead(4);
     list.Insert(1, 6);
     Assert.IsTrue(list.ReturnByIndex(1) == 6);
 }
Example #5
0
 public void FindIndexGoodTest()
 {
     List<int> list = new List<int>();
     list.AddToHead(10);
     Assert.IsTrue(list.FindIndex(10) == 0);
 }
Example #6
0
 public void ExistTest()
 {
     List<int> list = new List<int>();
     list.AddToHead(10);
     Assert.IsTrue(list.Exist(10) == true);
 }
Example #7
0
 public void AddToHeadTest()
 {
     List<int> list = new List<int>();
     list.AddToHead(10);
     Assert.IsTrue(list.Size() == 1);
 }
Example #8
0
 public void WriteGoodTest()
 {
     List<int> list = new List<int>();
     list.AddToHead(10);
     list.AddToHead(9);
     list.AddToHead(9);
     string test = "9, 9, 10";
     Assert.IsTrue(list.Write() == test);
 }
Example #9
0
 public void ReturnByIndexGoodTest()
 {
     List<int> list = new List<int>();
     list.AddToHead(9);
     Assert.IsTrue(list.ReturnByIndex(0) == 9);
 }