public void IsEmptyTest2()
 {
     List myList = new List();
     myList.AddElement(123);
     myList.AddElement(321);
     myList.AddElement(132);
     myList.DeleteElement(123);
     Assert.AreEqual(false, myList.IsEmpty());
 }
 public void DeleteElementTest2()
 {
     List myList = new List();
     myList.AddElement(8);
     myList.AddElement(-8);
     Assert.AreEqual(true, myList.DeleteElement(8));
     Assert.AreEqual(true, myList.DeleteElement(-8));
     Assert.AreEqual(false, myList.DeleteElement(8));
 }
Beispiel #3
0
 /// <summary>
 /// The entry point of the program, where the program control starts and ends.
 /// </summary>
 /// <param name="args">The command-line arguments.</param>
 public static void Main(string[] args)
 {
     List myList = new List();
     myList.AddElement(12);
     Console.WriteLine(myList.DeleteElement(12));
     Console.WriteLine(myList.DeleteElement(13));
 }
 public void LastTestTest()
 {
     List myList = new List();
     myList.AddElement(0);
     myList.AddElement(1);
     Assert.AreEqual(true, myList.DeleteElement(0));
     Assert.AreEqual(false, myList.DeleteElement(0));
     myList.AddElement(2);
     myList.AddElement(2);
     Assert.AreEqual(true, myList.DeleteElement(2));
     Assert.AreEqual(true, myList.DeleteElement(2));
     myList.DeleteElement(1);
     Assert.AreEqual(true, myList.IsEmpty());
 }
 public void IsNotEmptyTest()
 {
     List myList = new List();
     myList.AddElement(123);
     Assert.AreEqual(false, myList.IsEmpty());
 }
 public void AddElement_UpperBorderTest()
 {
     List myList = new List();
     myList.AddElement(int.MaxValue);
     Assert.AreEqual(true, myList.DeleteElement(int.MaxValue));
 }