Ejemplo n.º 1
0
        public void AList1_Set_error()
        {
            AList1 al = new AList1(new int[] { 1, 2, 9, 5, 6, 7 });

            al.Set(42, 3);
            Assert.AreEqual("1 2 9 42 6 7 ", al.ToString());
        }
Ejemplo n.º 2
0
        public void AListSet16Test()
        {
            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.Set(8, -3);
            mas = new int[16] {
                1, 2, 3, 4, 5, 6, 7, 8, -3, 10, 11, 12, 13, 14, 15, 16
            };
            Assert.AreEqual(16, a.Size());
            Assert.AreEqual(-3, a.Get(8));
            CollectionAssert.AreEqual(mas, a.ToArray());
        }
Ejemplo n.º 3
0
        public void AListSet16Test()
        {
            var a = new AList1 <Person>();

            a.Init(mas);
            a.Set(8, new Person(17, "rr", "qwer", 22));
            mas = new Person[16] {
                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(17, "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)
            };
            Assert.AreEqual(16, a.Size());
            Assert.AreEqual((new Person(17, "rr", "qwer", 22)).ToString(), a.Get(8).ToString());
            Assert.AreEqual(a.ToArray().ToString(), mas.ToString());
        }