public void Zip_TwoLists_CheckIndex() { CustomList <int> zippedList = new CustomList <int>(); CustomList <int> list1 = new CustomList <int>(); CustomList <int> list2 = new CustomList <int>(); for (int i = 0; i < 3; i++) { list1.Add(i); list2.Add(i); } zippedList = CustomList <int> .ZipLists(list1, list2); Assert.AreEqual(zippedList[0], zippedList[1]); }
public void Zip_ZippedList_Capacity() { CustomList <int> zippedList = new CustomList <int>(); CustomList <int> list1 = new CustomList <int>(); CustomList <int> list2 = new CustomList <int>(); CustomList <int> expectedList = new CustomList <int>() { 0, 0, 1, 1, 2, 2 }; for (int i = 0; i < 3; i++) { list1.Add(i); list2.Add(i); } zippedList = CustomList <int> .ZipLists(list1, list2); Assert.AreEqual(expectedList.Capacity, zippedList.Capacity); }
public void Zip_TwoLists_ZippedList() { CustomList <int> zippedList = new CustomList <int>(); CustomList <int> list1 = new CustomList <int>() { 1, 2 }; CustomList <int> list2 = new CustomList <int>() { 1, 2 }; CustomList <int> expectedList = new CustomList <int>() { 1, 1, 2, 2 }; zippedList = CustomList <int> .ZipLists(list1, list2); Assert.IsTrue(CustomList <int> .CompareLists(expectedList, zippedList)); }