Ejemplo n.º 1
0
 public void AListSize36Test()
 { 
     var a = new AList2<Person>();
     a.Init(mas);
     int size = a.Size();
     Assert.AreEqual(36, size);
 }
Ejemplo n.º 2
0
 public void AListTOArrey36Test()
 {
     var a = new AList2<Person>();
     a.Init(mas);
     int size = a.Size();
     Assert.AreEqual(36, size);
     CollectionAssert.AreEqual(mas, a.ToArray());
 }
Ejemplo n.º 3
0
 public void AListSize36Test()
 {
     int[] mas = new int[36] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 33, 34, 35, 36 };
     var a = new AList2<int>();
     a.Init(mas);
     int size = a.Size();
     Assert.AreEqual(36, size);
 }
Ejemplo n.º 4
0
 public void AListAddPos36Test()
 {
     int[] mas = new int[36] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 33, 34, 35, 36 };
     var a = new AList2<int>();
     a.Init(mas);
     a.AddPos(2, -1);
     int size = a.Size();
     mas = new int[37] { 1, 2, -1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 33, 34, 35, 36 };
     Assert.AreEqual(37, size);
     CollectionAssert.AreEqual(mas, a.ToArray());
 }
Ejemplo n.º 5
0
 public void AListAddEnd36Test()
 {
     var a = new AList2<Person>();
     a.Init(mas);
     a.AddEnd(new Person(0, "rr", "qwer", 22));
     int size = a.Size();
     mas = new Person[37] {new Person(1, "rr", "qwer", 22), new Person(2, "rr", "qwer", 22), new Person(3, "rr", "qwer", 22), new Person(4, "rr", "qwer", 22),
         new Person(5, "rr", "qwer", 22), new Person(6, "rr", "qwer", 22), new Person(7, "rr", "qwer", 22), new Person(8, "rr", "qwer", 22), new Person(9, "rr", "qwer", 22),
         new Person(10, "rr", "qwer", 22), new Person(11, "rr", "qwer", 22), new Person(12, "rr", "qwer", 22), new Person(13, "rr", "qwer", 22), new Person(14, "rr", "qwer", 22),
         new Person(15, "rr", "qwer", 22), new Person(16, "rr", "qwer", 22), new Person(17, "rr", "qwer", 22), new Person(18, "rr", "qwer", 22), new Person(19, "rr", "qwer", 22), new Person(20, "rr", "qwer", 22),
         new Person(21, "rr", "qwer", 22), new Person(22, "rr", "qwer", 22), new Person(23, "rr", "qwer", 22), new Person(24, "rr", "qwer", 22), new Person(25, "rr", "qwer", 22),
         new Person(26, "rr", "qwer", 22), new Person(27, "rr", "qwer", 22), new Person(28, "rr", "qwer", 22), new Person(29, "rr", "qwer", 22), new Person(30, "rr", "qwer", 22),
         new Person(31, "rr", "qwer", 22), new Person(32, "rr", "qwer", 22), new Person(33, "rr", "qwer", 22), new Person(34, "rr", "qwer", 22),new Person(35, "rr", "qwer", 22),new Person(36, "rr", "qwer", 22), new Person(0, "rr", "qwer", 22)};
     Assert.AreEqual(37, size);
     Assert.AreEqual(mas.ToString(), a.ToArray().ToString());
 }
Ejemplo n.º 6
0
        static void Main(string[] args)
        {
            AList2 arr0 = new AList2();
            int[] array = { 10, 1, 2, 5, 8 };

            arr0.Init(array);
            arr0.Output();

            Console.WriteLine("Min = " + arr0.Min());
            Console.WriteLine("Min index = " + arr0.MinIndex());
            Console.WriteLine("Max = " + arr0.Max());
            Console.WriteLine("Max index = " + arr0.MaxIndex());
            Console.WriteLine("__________________________________");

            arr0.AddStart(2);
            arr0.AddEnd(7);
            arr0.AddPos(20, 1);
            arr0.Output();
            Console.WriteLine("__________________________________");

            arr0.DelStart();
            arr0.DelEnd();
            arr0.DelPos(2);
            arr0.Output();
            Console.WriteLine("__________________________________");

            arr0.Reverse();
            arr0.Output();
            Console.WriteLine("__________________________________");
            arr0.HalfReverse();
            arr0.Output();
            Console.WriteLine("__________________________________");

            Console.WriteLine("Index = 2: " + arr0.Get(2));
            Console.WriteLine("__________________________________");
            arr0.Set(-78, 3);
            arr0.Output();
            Console.WriteLine("__________________________________");
            arr0.Sort();
            arr0.Output();
            Console.WriteLine("__________________________________");
            arr0.Clear();
            arr0.Output();

            Console.ReadLine();
        }
Ejemplo n.º 7
0
 public void AListSort36Test()
 {
     var a = new AList2();
     int[] mas = new int[36] { 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 };
     a.Init(mas);
     a.Sort();
     Assert.AreEqual(36, a.Size());
     mas = new int[36] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36 };
     CollectionAssert.AreEqual(mas, a.ToArray());
 }
Ejemplo n.º 8
0
 public void AListSet36Test()
 {
     var a = new AList2();
     int[] mas = new int[36] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 33, 34, 35, 36 };
     a.Init(mas);
     a.Set(6, -7);
     Assert.AreEqual(36, a.Size());
     Assert.AreEqual(-7, a.Get(6));
     mas = new int[36] { 1, 2, 3, 4, 5, 6, -7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 33, 34, 35, 36 };
     CollectionAssert.AreEqual(mas, a.ToArray());
 }
Ejemplo n.º 9
0
 public void AListGet36Test()
 {
     var a = new AList2();
     int[] mas = new int[36] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 33, 34, 35, 36 };
     a.Init(mas);
     int res = a.Get(6);
     Assert.AreEqual(7, res);
 }
Ejemplo n.º 10
0
 public void AListDelpos36Test()
 {
     var a = new AList2();
     int[] mas = new int[36] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 33, 34, 35, 36 };
     a.Init(mas);
     int res = a.DelPos(5);
     int size = a.Size();
     mas = new int[35] { 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 33, 34, 35, 36 };
     Assert.AreEqual(35, size);
     Assert.AreEqual(6, res);
     CollectionAssert.AreEqual(mas, a.ToArray());
 }
Ejemplo n.º 11
0
 public void AListTOArrey36Test()
 {
     var a = new AList2();
     int[] mas = new int[36] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 33, 34, 35, 36 };
     a.Init(mas);
     int size = a.Size();
     Assert.AreEqual(36, size);
     CollectionAssert.AreEqual(mas, a.ToArray());
 }
Ejemplo n.º 12
0
 public void AListClear36Test()
 {
     var a = new AList2();
     int[] mas = new int[36];
     a.Init(mas);
     a.Clear();
     int size = a.Size();
     Assert.AreEqual(0, size);
 }
Ejemplo n.º 13
0
 public void AListHalfReverseOdd36Test()
 {
     int[] mas = new int[36] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36 };
     var a = new AList2<int>();
     a.Init(mas);
     a.HalfReverse();
     int size = a.Size();
     mas = new int[36] { 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 };
     Assert.AreEqual(36, size);
     CollectionAssert.AreEqual(mas, a.ToArray());
 }
Ejemplo n.º 14
0
 public void AListMaxI36Test()
 {
     int[] mas = new int[36] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 33, 34, 35, 36 };
     var a = new AList2<int>();
     a.Init(mas);
     int res = a.MaxI();
     Assert.AreEqual(35, res);
 }