コード例 #1
0
 public void AListSize16Test()
 {
     var a = new AList1<Person>();
     a.Init(mas);
     int size = a.Size();
     Assert.AreEqual(16, size);
 }
コード例 #2
0
 public void AListSize16Test()
 {
     var a = new AList1<int>();
     int[] mas = new int[16];
     a.Init(mas);
     int size = a.Size();
     Assert.AreEqual(16, size);
 }
コード例 #3
0
 public void AListTOArrey16Test()
 {
     var a = new AList1<Person>();
     a.Init(mas);
     int size = a.Size();
     Assert.AreEqual(16, size);
     CollectionAssert.AreEqual(mas, a.ToArray());
 }
コード例 #4
0
ファイル: AListTest.cs プロジェクト: MGnuskina/Tasks
 public void AListClear16Test()
 {
     var a = new AList1();
     int[] mas = new int[16];
     a.Init(mas);
     a.Clear();
     int size = a.Size();
     Assert.AreEqual(0, size);
 }
コード例 #5
0
 public void AListTOArrey16Test()
 {
     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);
     int size = a.Size();
     Assert.AreEqual(16, size);
     CollectionAssert.AreEqual(mas, a.ToArray());
 }
コード例 #6
0
 public void AListAddStart16Test()
 {
     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.AddStart(-1);
     int size = a.Size();
     Assert.AreEqual(17, size);
     mas = new int[17] { -1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
     CollectionAssert.AreEqual(mas, a.ToArray());
 }
コード例 #7
0
 public void AListAddStart16Test()
 {
     var a = new AList1<Person>();
     a.Init(mas);
     Person tmp = new Person(17, "rr", "qwer", 22);
     a.AddStart(tmp);
     int size = a.Size();
     Assert.AreEqual(17, size);
     mas = new Person[17] {new Person(17,"rr","qwer",22), 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)};
     Assert.AreEqual(mas.ToString(), a.ToArray().ToString());
 }
コード例 #8
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());
 }
コード例 #9
0
ファイル: AListTest.cs プロジェクト: MGnuskina/Tasks
 public void AListMaxI16Test()
 {
     var a = new AList1();
     int[] mas = new int[16] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
     a.Init(mas);
     int res = a.MaxI();
     Assert.AreEqual(15, res);
 }
コード例 #10
0
 public void AListHalfREverseOdd16Test()
 {
     int[] mas = new int[15] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
     var a = new AList1<int>();
     a.Init(mas);
     a.HalfReverse();
     int size = a.Size();
     Assert.AreEqual(15, size);
     mas = new int[15] { 9, 10, 11, 12, 13, 14, 15, 8, 1, 2, 3, 4, 5, 6, 7 };
     CollectionAssert.AreEqual(mas, a.ToArray());
 }
コード例 #11
0
 public void AListGet16Test()
 {
     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);
     int res = a.Get(3);
     Assert.AreEqual(4, res);
 }
コード例 #12
0
 public void AListMax16Test()
 {
     var a = new AList1<Person>();
     a.Init(mas);
     Person res = a.Max();
     Assert.AreEqual(16, res.ID);
 }
コード例 #13
0
 public void AListDelPos16Test()
 {
     var a = new AList1<Person>();
     a.Init(mas);
     Person res = a.DelPos(3);
     int size = a.Size();
     Assert.AreEqual(15, size);
     Assert.AreEqual(res.ToString(), (new Person(6, "rr", "qwer", 22)).ToString());
     mas = new Person[15] { new Person(1, "rr", "qwer", 22), new Person(2, "rr", "qwer", 22), new Person(3, "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)};
     Assert.AreEqual(a.ToArray().ToString(), mas.ToString());
 }
コード例 #14
0
ファイル: AListTest.cs プロジェクト: MGnuskina/Tasks
 public void AListHalfREverseEven16Test()
 {
     var a = new AList1();
     int[] mas = new int[16] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
     a.Init(mas);
     a.HalfReverse();
     int size = a.Size();
     Assert.AreEqual(16, size);
     mas = new int[16] { 9, 10, 11, 12, 13, 14, 15, 16, 1, 2, 3, 4, 5, 6, 7, 8 };
     CollectionAssert.AreEqual(mas, a.ToArray());
 }
コード例 #15
0
ファイル: AListTest.cs プロジェクト: MGnuskina/Tasks
 public void AListSort16Test()
 {
     var a = new AList1();
     int[] mas = new int[16] { 1, 5, 6, 7, 8, 2, 3, 4, 12, 13, 14, 15, 16, 9, 10, 11 };
     a.Init(mas);
     a.Sort();
     mas = new int[16] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
     Assert.AreEqual(16, a.Size());
     CollectionAssert.AreEqual(mas, a.ToArray());
 }
コード例 #16
0
 public void AListDelStart16Test()
 {
     var a = new AList1<Person>();
     a.Init(mas);
     Person res = a.DelStart();
     int size = a.Size();
     Assert.AreEqual(15, size);
     Assert.AreEqual(res.ToString(), (new Person(1, "rr", "qwer", 22)).ToString());
     Assert.AreEqual(a.ToArray().ToString(), mas.ToString());
 }
コード例 #17
0
 public void AListMaxI16Test()
 {
     var a = new AList1<Person>();
     a.Init(mas);
     int res = a.MaxI();
     Assert.AreEqual(15, res);
 }
コード例 #18
0
 public void AListHalfREverseOdd16Test()
 {
     Person[] mas = new Person[15] { 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),};
     var a = new AList1<Person>();
     a.Init(mas);
     a.HalfReverse();
     int size = a.Size();
     Assert.AreEqual(15, size);
     mas = new Person[15] { 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(8, "rr", "qwer", 22),  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),};
     Assert.AreEqual(a.ToArray().ToString(), mas.ToString());
 }
コード例 #19
0
 public void AListSort16Test()
 {
     var a = new AList1<Person>();
     a.Init(mas);
     a.Sort();
     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(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)};
     Assert.AreEqual(16, a.Size());
     Assert.AreEqual(a.ToArray().ToString(), mas.ToString());
 }
コード例 #20
0
 public void AListGet16Test()
 {
     var a = new AList1<Person>();
     a.Init(mas);
     Person res = a.Get(3);
     Assert.AreEqual((new Person(10, "rr", "qwer", 22)).ToString(), res.ToString());
 }
コード例 #21
0
 public void AListDelStart16Test()
 {
     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);
     int res = a.DelStart();
     int size = a.Size();
     Assert.AreEqual(15, size);
     Assert.AreEqual(1, res);
     mas = new int[15] { 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
     CollectionAssert.AreEqual(mas, a.ToArray());
 }
コード例 #22
0
 public void TestMethodAddEndNull()
 {
     AList1 arr1 = new AList1();
     arr1.Init(null);
     arr1.AddEnd(40);
 }