Пример #1
0
        public void AList1_Reverse_error()
        {
            AList1 al = new AList1(new int[] { 1, 2, 9, 5, 6, 7 });

            al.Reverse();
            Assert.AreEqual("7 6 5 9 2 1 ", al.ToString());
        }
Пример #2
0
        public void AListREverse16Test()
        {
            int[] mas = new int[16] {
                1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
            };
            var a = new AList1 <int>();

            a.Init(mas);
            a.Reverse();
            int size = a.Size();

            Assert.AreEqual(16, size);
            mas = new int[16] {
                16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
            };
            CollectionAssert.AreEqual(mas, a.ToArray());
        }
Пример #3
0
        public void AListREverse16Test()
        {
            var a = new AList1 <Person>();

            a.Init(mas);
            a.Reverse();
            int size = a.Size();

            Assert.AreEqual(16, size);
            mas = new Person[16] {
                new Person(16, "rr", "qwer", 22), new Person(15, "rr", "qwer", 22), new Person(14, "rr", "qwer", 22), new Person(13, "rr", "qwer", 22),
                new Person(12, "rr", "qwer", 22), new Person(11, "rr", "qwer", 22), new Person(10, "rr", "qwer", 22), new Person(9, "rr", "qwer", 22), new Person(8, "rr", "qwer", 22),
                new Person(7, "rr", "qwer", 22), new Person(6, "rr", "qwer", 22), new Person(5, "rr", "qwer", 22), new Person(4, "rr", "qwer", 22), new Person(3, "rr", "qwer", 22),
                new Person(2, "rr", "qwer", 22), new Person(1, "rr", "qwer", 22)
            };
            Assert.AreEqual(a.ToArray().ToString(), mas.ToString());
        }