Beispiel #1
0
 public void AddLastTest(int[] a, int[] ex)
 {
     ArrayListProject.ArrayList al = new ArrayListProject.ArrayList();
     al.AddLast(a);
     int[] actual = al.ToArray();
     Assert.AreEqual(ex, actual);
 }
Beispiel #2
0
 public void AddAtTest(int a, int[] b, int[] ex)
 {
     int[] array = new int[] { 2, 2, 2, 5, 8 };
     ArrayListProject.ArrayList al = new ArrayListProject.ArrayList(array);
     al.AddAt(a, b);
     int[] actual = al.ToArray();
     Assert.AreEqual(ex, actual);
 }
Beispiel #3
0
 public void AddFirstTest(int[] a, int[] ex)
 {
     int[] array = new int[] { 2, 2, 2 };
     ArrayListProject.ArrayList al = new ArrayListProject.ArrayList(array);
     al.AddFirst(a);
     int[] actual = al.ToArray();
     Assert.AreEqual(ex, actual);
 }
Beispiel #4
0
        public void IndexOfMinTest(int ex)
        {
            int[] array = new int[] { 2, 2, 2, 5, 8 };
            ArrayListProject.ArrayList al = new ArrayListProject.ArrayList(array);
            int actual = al.IndexOfMin();

            Assert.AreEqual(ex, actual);
        }
Beispiel #5
0
 public void SortDescTest(int[] ex)
 {
     int[] array = new int[] { 6, 7, 8, 1, 2 };
     ArrayListProject.ArrayList al = new ArrayListProject.ArrayList(array);
     al.SortDesc();
     int[] actual = al.ToArray();
     Assert.AreEqual(ex, actual);
 }
Beispiel #6
0
        public void GetTest(int a, int ex)
        {
            int[] array = new int[] { 2, 2, 2, 5, 8 };
            ArrayListProject.ArrayList al = new ArrayListProject.ArrayList(array);
            int actual = al.Get(a);

            Assert.AreEqual(ex, actual);
        }
Beispiel #7
0
        public void ContainsTest(int a, bool ex)
        {
            int[] array = new int[] { 2, 2, 2, 5, 8 };
            ArrayListProject.ArrayList al = new ArrayListProject.ArrayList(array);
            bool actual = al.Contains(a);

            Assert.AreEqual(ex, actual);
        }
Beispiel #8
0
 public void RemoveAllTest(int a, int[] ex)
 {
     int[] array = new int[] { 1, 2, 2, 2, 5, 8, 5, 2 };
     ArrayListProject.ArrayList al = new ArrayListProject.ArrayList(array);
     al.RemoveAll(a);
     int[] actual = al.ToArray();
     Assert.AreEqual(ex, actual);
 }
Beispiel #9
0
 public void RemoveLastTest(int[] ex)
 {
     int[] array = new int[] { 2, 2, 2, 5, 8 };
     ArrayListProject.ArrayList al = new ArrayListProject.ArrayList(array);
     al.RemoveLast();
     int[] actual = al.ToArray();
     Assert.AreEqual(ex, actual);
 }
Beispiel #10
0
 public void ReverseTest(int[] array, int[] ex)
 {
     ArrayListProject.ArrayList al = new ArrayListProject.ArrayList(array);
     int[] actual = al.Reverse();
     Assert.AreEqual(ex, actual);
 }