public void Zip_OtherListIsEmpty_OriginalList() { //Arrange CustomList <int> customList1 = new CustomList <int>(); CustomList <int> customList2 = new CustomList <int>(); customList2.Add(1); customList2.Add(3); customList2.Add(5); customList1.Add(1); customList1.Remove(1); CustomList <int> expectedResult = customList2; //Act CustomList <int> result = CustomList <int> .Zip(customList1, customList2); //Assert Assert.IsTrue(ListsAreEqual(expectedResult, result)); }
public void Zip_ListToNothing_ReturnCount() { //Arrange string x = "x"; CustomList <string> list1 = new CustomList <string>() { x, x, x }; CustomList <string> list2 = new CustomList <string>() { }; int expectedCount = 3; //Act list1.Zip(list2); int listCount = list1.Count; //Assert Assert.AreEqual(expectedCount, listCount); }
public void Zip_ListItems_ReturnZippedListIndexThree() { //Arrange CustomList <int> customListOne = new CustomList <int>() { 0, 2, 4, 6 }; CustomList <int> customListTwo = new CustomList <int>() { 1, 3, 5, 7 }; int indexTest = 3; //Act customListOne.Zip(customListTwo); int index = customListOne[indexTest]; //Assert Assert.AreEqual(index, indexTest); }
public void Zip_NothingToList_ReturnCount() { //Arrange string o = "o"; CustomList <string> list1 = new CustomList <string>() { }; CustomList <string> list2 = new CustomList <string>() { o, o, o }; int expectedCount = 3; //Act list1.Zip(list2); int listCount = list1.Count; //Assert Assert.AreEqual(expectedCount, listCount); }
public void Zip_ListWithStringDataType() { //Arrange CustomList <string> items1 = new CustomList <string>() { "Hi", "name", "Kee" }; CustomList <string> items2 = new CustomList <string>() { "my", "is", "Cha" }; CustomList <string> items = new CustomList <string>(); string expected = "HimynameisKeeCha"; //Act items = items1.Zip(items2); string actual = items.ToString(); //Assert Assert.AreEqual(expected, actual); }
public void Zip_CheckCapacityOfNewListWhenZipTwoList() { //Arrange CustomList <int> items = new CustomList <int>() { 1, 2 }; CustomList <int> items1 = new CustomList <int>() { 2, 3, 4, }; CustomList <int> items2 = new CustomList <int>(); int expected = 8; //Act items2 = items.Zip(items1); int actual = items2.Capacity; //Assert Assert.AreEqual(expected, actual); }
public void Zip_CheckCountOFListAfterZip() { //Arrange CustomList <int> items = new CustomList <int>() { 1, 2, 3, 4 }; CustomList <int> items1 = new CustomList <int>() { 5, 6, 7, 8 }; CustomList <int> items2 = new CustomList <int>(); int expected = 8; //Act items2 = items.Zip(items1); int actual = items2.Count; //Assert Assert.AreEqual(expected, actual); }
public void Zip_CheckListOrderOfTwoList() { //Arrange CustomList <int> items1 = new CustomList <int>() { 1, 3, 5, 7, 9 }; CustomList <int> items2 = new CustomList <int>() { 2, 4, 8 }; CustomList <int> items = new CustomList <int>(); string expected = "12345879"; //Act items = items1.Zip(items2); string actual = items.ToString(); //Assert Assert.AreEqual(expected, actual); }
public void Zip_EmptyStringFirst_NoListMade() { CustomList <string> stringListBig = new CustomList <string>(); CustomList <string> stringListSmall = new CustomList <string>(); string letter = "A"; string letter2 = "C"; string expected = "AC"; CustomList <string> actualList; string actual; //Act stringListBig.Add(letter); stringListBig.Add(letter2); actualList = stringListSmall.Zip(stringListBig); actual = actualList.ToString(); //Assert Assert.AreEqual(expected, actual); }
public void Zip_ListsOfObjects_ReturnCount() { //Arrange Random random = new Random(); CustomList <Random> list1 = new CustomList <Random>() { random, random, random }; CustomList <Random> list2 = new CustomList <Random>() { random, random, random }; int expectedCount = 6; //Act list1.Zip(list2); int listCount = list1.Count; //Assert Assert.AreEqual(expectedCount, listCount); }
public void Check_Zip_ZipList() { //Arrange CustomList <int> odd = new CustomList <int>() { 1, 3, 5 }; CustomList <int> even = new CustomList <int>() { 2, 4, 6 }; CustomList <int> zipList; int expectedResult = 123456; //Arrange zipList = CustomList <int> .Zip(odd, even); //Assert Assert.AreEqual(expectedResult, 123456); }
public void Zip_WorksNormally() { // arrange CustomList <int> oddTestList = new CustomList <int>(); CustomList <int> evenTestList = new CustomList <int>(); CustomList <int> resultTestList = new CustomList <int>(); int expected = 3; // act oddTestList.Add(1); oddTestList.Add(3); oddTestList.Add(5); evenTestList.Add(2); evenTestList.Add(4); evenTestList.Add(6); resultTestList = oddTestList.Zip(evenTestList); int actual = resultTestList[2]; // assert Assert.AreEqual(expected, actual); }
public void ZipMethod_CheckNewListForSuccessfulZipIndex2_isTrue() { // Arrange CustomList <int> list1 = new CustomList <int>() { 1, 3, 5 }; CustomList <int> list2 = new CustomList <int>() { 2, 4, 6 }; CustomList <int> expectedList = new CustomList <int> { 1, 2, 3, 4, 5, 6 }; // Act var resultList = list1.Zip(list2); var expectedResult = expectedList[2]; // Assert Assert.AreEqual(expectedResult, resultList[2]); }
public void Check_ZipWithRemainder_ZipList2() { //Arrange CustomList <int> odd = new CustomList <int>() { 1, 3, 5 }; CustomList <int> even = new CustomList <int>() { 2, 4, 6, 8, 10 }; CustomList <int> zipList = new CustomList <int>(); string expectedResult = "123456810"; //Act zipList = CustomList <int> .Zip(odd, even); string actualResult = zipList.ToString(); //Assert Assert.AreEqual(expectedResult, actualResult); }
public void Zip_SameSizeLists_ReturnCount() { //Arrange string x = "x"; string o = "o"; CustomList <string> list1 = new CustomList <string>() { x, x, x }; CustomList <string> list2 = new CustomList <string>() { o, o, o }; int expectedCount = 6; //Act list1.Zip(list2); int listCount = list1.Count; //Assert Assert.AreEqual(expectedCount, listCount); }
public void ZipMethod_CheckListForSameTypePostZip_isEqual() { // Arrange CustomList <int> list1 = new CustomList <int>() { 1, 3, 5 }; CustomList <int> list2 = new CustomList <int>() { 2, 4, 6 }; CustomList <int> expectedList = new CustomList <int> { 1, 2, 3, 4, 5, 6 }; // Act var resultList = list1.Zip(list2); var expectedResult = expectedList; // Assert Assert.IsInstanceOfType(expectedResult, typeof(CustomList <int>)); }
public void Zip_CountRight() { // arrange CustomList <int> oddTestList = new CustomList <int>(); CustomList <int> evenTestList = new CustomList <int>(); CustomList <int> resultTestList = new CustomList <int>(); int expected = 6; // act oddTestList.Add(1); oddTestList.Add(3); oddTestList.Add(5); evenTestList.Add(2); evenTestList.Add(4); evenTestList.Add(6); resultTestList = oddTestList.Zip(evenTestList); int actual = resultTestList.Count; // assert Assert.AreEqual(expected, actual); }
public void Zip_ZipTwoLists_CountIncreases() { //arrange CustomList <int> numbers1 = new CustomList <int>(); numbers1.Add(1); numbers1.Add(3); CustomList <int> numbers2 = new CustomList <int>(); numbers2.Add(2); numbers2.Add(4); CustomList <int> finalNumbers = new CustomList <int>(); finalNumbers.Zip(numbers1, numbers2); int expected = 4; int actual; //act actual = finalNumbers.Count; //assert Assert.AreEqual(expected, actual); }
public void Zip_ArgumentOutOfRange() { //Arrange CustomList <int> list = new CustomList <int>() { 1, 3, 5 }; CustomList <int> list2 = new CustomList <int>() { 2, 4, 6 }; CustomList <int> list3 = new CustomList <int>(); //Act list3 = list.Zip(list2); int num = list3[8]; //Assert }
public void Zip_ZipTwoLists_NewListCreated() { //arrange CustomList <int> numbers1 = new CustomList <int>(); numbers1.Add(1); numbers1.Add(3); CustomList <int> numbers2 = new CustomList <int>(); numbers2.Add(2); numbers2.Add(4); CustomList <int> finalNumbers = new CustomList <int>(); finalNumbers.Zip(numbers1, numbers2); int expected = 2; int actual; //act actual = finalNumbers[1]; //assert Assert.AreEqual(expected, actual); }
public void Zip_ZipTwoListsTogether_ListHasCorrectValues() { //Arrange CustomList <int> testListOne = new CustomList <int>(); testListOne.Add(111); testListOne.Add(222); testListOne.Add(333); CustomList <int> testListTwo = new CustomList <int>(); testListTwo.Add(444); testListTwo.Add(555); testListTwo.Add(666); string expected = "111, 444, 222, 555, 333, 666"; string actual; //Act actual = CustomList <int> .Zip(testListOne, testListTwo).ToString(); //Assert Assert.AreEqual(expected, actual); }
public void ZipMethod_CheckCountAfterZipForEqualLengthFromBothListCombined_isEqual() { // Arrange CustomList <int> list1 = new CustomList <int>() { 1, 3, 5 }; CustomList <int> list2 = new CustomList <int>() { 2, 4, 6 }; CustomList <int> combinedList = new CustomList <int>(); CustomList <int> expectedList = new CustomList <int>() { 1, 2, 3, 4, 5, 6 }; // Act combinedList = list1.Zip(list2); // Assert Assert.AreEqual(expectedList.Count, combinedList.Count); }
public void Zip_TwoIntList_GetResult() { //Arrange CustomList <int> numberListOne = new CustomList <int>() { 1, 3, 5 }; CustomList <int> numberListTwo = new CustomList <int>() { 2, 4, 6 }; CustomList <int> zippedList = new CustomList <int>(); CustomList <int> expected = new CustomList <int>() { 1, 2, 3, 4, 5, 6 }; //Act zippedList = zippedList.Zip(numberListOne, numberListTwo); //Assert Assert.AreEqual(expected.ToString(), zippedList.ToString()); }
public void ZipMethod_CheckListAfterZipIfListAreTwoDifferentSizes_isEqual() { // Arrange CustomList <int> list1 = new CustomList <int>() { 1, 3, 5, 7, 8, 9, 10 }; CustomList <int> list2 = new CustomList <int>() { 2, 4, 6 }; CustomList <int> expectedList = new CustomList <int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; // Act var actualResult = list1.Zip(list2); var expectedResult = expectedList.Count; // Assert Assert.AreEqual(expectedResult, actualResult.Count); }
public void ZipMethod_CheckNewListForCorrectOrderAfterZip_isTrue() { // Arrange CustomList <int> list1 = new CustomList <int>() { 1, 3, 5 }; CustomList <int> list2 = new CustomList <int>() { 2, 4, 6 }; CustomList <int> expectedList = new CustomList <int> { 2, 1, 4, 3, 6, 5 }; // Act var resultList = list2.Zip(list1); var actualResults = resultList.ToString(); var expectedResult = expectedList.ToString(); // Assert Assert.AreEqual(expectedResult, actualResults); }
public void Zip_List_Count_Is_Sum_of_Each_Parameter_Lists_Count() { //Arrange CustomList <string> a = new CustomList <string>(); CustomList <string> b = new CustomList <string>(); a.Add("one"); a.Add("two"); b.Add("three"); b.Add("four"); int aCount = a.Count; int expected = 4; int actual; //Act a.Zip(b); actual = aCount + b.Count; //Assert Assert.AreEqual(expected, actual); }
public void Zip_ZipTwoListsTogether_ListHasCorrectCount() { //Arrange CustomList <int> testListOne = new CustomList <int>(); testListOne.Add(111); testListOne.Add(222); testListOne.Add(333); CustomList <int> testListTwo = new CustomList <int>(); testListTwo.Add(444); testListTwo.Add(555); testListTwo.Add(666); int expected = 6; int actual; //Act CustomList <int> result = CustomList <int> .Zip(testListOne, testListTwo); actual = result.Count; //Assert Assert.AreEqual(expected, actual); }
public void Zip_Capacity() { //Arrange CustomList <int> list = new CustomList <int>() { 1, 3, 5 }; CustomList <int> list2 = new CustomList <int>() { 2, 4, 6 }; CustomList <int> list3 = new CustomList <int>(); int expected = 8; //Act list3 = list.Zip(list2); int actual = list3.Capacity; //Assert Assert.AreEqual(expected, actual); }
public void Zip_In_Order() { //Arrange CustomList <int> list = new CustomList <int>() { 1, 3, 5 }; CustomList <int> list2 = new CustomList <int>() { 2, 4, 6 }; CustomList <int> list3 = new CustomList <int>(); string expected = "123456"; //Act list3 = list.Zip(list2); string actual = list3.ToString(); //Assert Assert.AreEqual(expected, actual); }
public void Zip_Check_If_All_Numbers_Gets_Zip_When_2nd_List_Is_Longer() { //Arrange CustomList <int> list = new CustomList <int>() { 1, 4 }; CustomList <int> list2 = new CustomList <int>() { 2, 3, 5, 6, 7 }; CustomList <int> list3 = new CustomList <int>(); string expected = "1243567"; //Act list3 = list.Zip(list2); string actual = list3.ToString(); //Assert Assert.AreEqual(expected, actual); }