public void AList2_AddStart_error() { AList2 al = new AList2(new int[] { 1, 2, 9, 5, 6, 7 }); al.AddStart(42); Assert.AreEqual("42 1 2 9 5 6 7 ", al.ToString()); }
public void AList2_AddPosition_error() { AList2 al = new AList2(new int[] { 1, 2, 9, 5, 6, 7 }); al.AddPosition(42, 4); Assert.AreEqual("1 2 9 5 42 6 7 ", al.ToString()); }
public void AList2_Delete_End_DeleteValue_error() { AList2 al = new AList2(new int[] { 1, 2, 9, 5, 6, 7 }); al.DeleteEnd(); Assert.AreEqual("1 2 9 5 6 ", al.ToString()); }
public void AList2_AddEnd_error() { AList2 al = new AList2(new int[] { 1, 2, 9, 5, 6, 7 }); al.AddEnd(42); Assert.AreEqual("1 2 9 5 6 7 42 ", al.ToString()); }
public void AList2_Half_Reverse_odd_error() { AList2 al = new AList2(new int[] { 1, 2, 9, 5, 6, 7 }); al.HalfReverse(); Assert.AreEqual("9 2 1 5 6 7 ", al.ToString()); }
public void AList2_Sort_error() { AList2 al = new AList2(new int[] { 2, 1, 9, 5, 6, 7 }); al.Sort(); Assert.AreEqual("1 2 5 6 7 9 ", al.ToString()); }
public void AList2_Set_error() { AList2 al = new AList2(new int[] { 1, 2, 9, 5, 6, 7 }); al.Set(42, 3); Assert.AreEqual("1 2 9 42 6 7 ", al.ToString()); }
public void AList2_Delete_Position_DeleteValue_error() { AList2 al = new AList2(new int[] { 1, 2, 9, 5, 6, 7 }); al.DeletePos(3); Assert.AreEqual("1 2 9 6 7 ", al.ToString()); }
public void AList2_Delete_Start_DeleteValue_error() { AList2 al = new AList2(new int[] { 1, 2, 9, 5, 6, 7 }); al.DeleteStart(); Assert.AreEqual("2 9 5 6 7 ", al.ToString()); }
private IList ConvertToListType(string iniString) { IList list = null; switch (iniString) { case "AList0": list = new AList0(); break; case "AList1": list = new AList1(); break; case "AList2": list = new AList2(); break; case "AListR": list = new AListR(); break; case "LList1": list = new LList1(); break; default: break; } return(list); }
public void AList2_Reverse_error() { AList2 al = new AList2(new int[] { 1, 2, 9, 5, 6, 7 }); al.Reverse(); Assert.AreEqual("7 6 5 9 2 1 ", al.ToString()); }
public void AListSize36Test() { var a = new AList2 <Person>(); a.Init(mas); int size = a.Size(); Assert.AreEqual(36, size); }
public void AListTOArrey36Test() { var a = new AList2 <Person>(); a.Init(mas); int size = a.Size(); Assert.AreEqual(36, size); CollectionAssert.AreEqual(mas, a.ToArray()); }
public void NU_Init_AList2(int[] ini, int size, int[] exp) { AList2 list = new AList2(); list.Init(ini); int[] act = list.ToArray(); Assert.AreEqual(size, list.Size()); CollectionAssert.AreEqual(exp, act); }
public void AListGet36Test() { 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.Get(6); Assert.AreEqual(7, res); }
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); }
public void AList2_Init_error() { AList2 al = new AList2(); al.Init(new int[] { 1, 2, 9, 5, 6, 2 }); AList2 al1 = new AList2(); al1.Init(new int[] { 1, 2, 9, 5, 6, 2 }); // AList2 al1 = new AList2(new int[] { 1, 2, 9, 5, 6, 2 }); Assert.AreEqual(al.ToString(), al1.ToString()); //Assert.AreEqual("1 2 9 5 6 ", al.ToString()); }
public void Init_AList2() { AList2 list = new AList2(); int[] exp = new int[40] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; list.Init(exp); int[] act = list.ToArray(); Assert.AreEqual(40, list.Size()); CollectionAssert.AreEqual(exp, act); }
public void NU_AddEnd_AList2(int val, int size, int[] exp) { AList2 list = new AList2(); for (int i = 0; i < size; ++i) { list.AddEnd(val); } int[] act = list.ToArray(); Assert.AreEqual(size, list.Size()); CollectionAssert.AreEqual(exp, act); }
public void NU_AddPos_AList2(int val, int size, int[] exp) { AList2 list = new AList2(); list.Init(new int[] { 1, 1 }); for (int i = 0; i < size - 2; ++i) { list.AddPos(1, val); } int[] act = list.ToArray(); Assert.AreEqual(size, list.Size()); CollectionAssert.AreEqual(exp, act); }
public void AListSort36Test() { int[] mas = new int[36] { 1, 9, 10, 27, 28, 29, 30, 31, 32, 2, 3, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 4, 5, 6, 7, 8, 33, 34, 35, 36 }; var a = new AList2 <int>(); 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()); }
public void AddStart_AList2() { AList2 list = new AList2(); for (int i = 0; i < 16; ++i) { list.AddStart(0); } int[] act = list.ToArray(); int[] exp = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; Assert.AreEqual(16, list.Size()); CollectionAssert.AreEqual(exp, act); }
public void AddEnd_Upscale_AList2() { AList2 list = new AList2(); for (int i = 0; i < 31; ++i) { list.AddEnd(0); } int[] act = list.ToArray(); int[] exp = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; Assert.AreEqual(31, list.Size()); CollectionAssert.AreEqual(exp, act); }
public void AddPos_Upscale_AList2() { AList2 list = new AList2(); list.Init(new int[] { 1, 1 }); for (int i = 0; i < 31 - 2; ++i) { list.AddPos(1, 0); } int[] act = list.ToArray(); int[] exp = new int[] { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }; Assert.AreEqual(31, list.Size()); CollectionAssert.AreEqual(exp, act); }
public void AListSet36Test() { 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.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()); }
public void AListHalfReverseEven36Test() { 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()); }
public void AListAddEnd36Test() { 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.AddEnd(-1); int size = a.Size(); mas = new int[37] { 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, -1 }; Assert.AreEqual(37, size); CollectionAssert.AreEqual(mas, a.ToArray()); }
public void AListDelpos36Test() { 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.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()); }
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()); }
public void AList2_Min_Index_error() { AList2 al = new AList2(new int[] { 1, 2, 9, 5, 6, 7 }); Assert.AreEqual(0, al.MinIndex()); }