public void Zip_TwoInstances_ReturnZippedValues() { CustomList <int> odd = new CustomList <int>(); CustomList <int> even = new CustomList <int>(); CustomList <int> result = new CustomList <int>(); odd.Add(1); odd.Add(3); odd.Add(5); even.Add(2); even.Add(4); even.Add(6); result = CustomList <int> .Zip(odd, even); int expected = 2; int actual = result[1]; Assert.AreEqual(expected, actual); }
public static void Zip_TieTwoArrays_ItemsWereZippedSuccessfully() { CustomList <int> test = new CustomList <int>(); test.Add(1); test.Add(2); test.Add(3); test.Add(4); CustomList <int> test2 = new CustomList <int>(); test2.Add(5); test2.Add(6); test2.Add(7); test2.Add(8); test.Zip(test2); actual = }
public void Zipper_GivenNulls_Zip() { //Arrange CustomList <int> list1 = new CustomList <int>() { 1, 3, 5 }; CustomList <int> list2 = new CustomList <int>() { 0 }; CustomList <int> resultList = new CustomList <int>(); int expectedResult = 5; int actualResult; //Act resultList = list1.Zip(list2); actualResult = resultList[3]; //Assert Assert.AreEqual(expectedResult, actualResult); }
public void Zipper_ResizedArray_True() { //Arrange CustomList <int> list1 = new CustomList <int>() { 1, 3, 5 }; CustomList <int> list2 = new CustomList <int>() { 2, 4, 6, 8 }; CustomList <int> resultList = new CustomList <int>(); int expectedResult = 8; int actualResult; //Act resultList = list1.Zip(list2); actualResult = resultList.capacity; //Assert Assert.AreEqual(expectedResult, actualResult); }
public void Zipper_ZippedCount_Right() { //Arrange CustomList <string> weekdays1 = new CustomList <string>() { "Monday", "Wednesday", "Friday", "Sunday" }; CustomList <string> weekdays2 = new CustomList <string>() { "Tuesday", "Thursday", "Saturday" }; CustomList <string> weekdays = new CustomList <string>(); int expectedCount = 7; int actualCount; //Act weekdays = weekdays1.Zip(weekdays2); actualCount = weekdays.count; //Assert Assert.AreEqual(expectedCount, actualCount); }
public void Zipper_List2After1_Yes() { //Arrange CustomList <string> weekdays1 = new CustomList <string>() { "Monday", "Wednesday", "Friday", "Sunday" }; CustomList <string> weekdays2 = new CustomList <string>() { "Tuesday", "Thursday", "Saturday" }; CustomList <string> weekdays = new CustomList <string>(); string expectedValue = "Monday"; string actualValue; //Act weekdays = weekdays1.Zip(weekdays2); actualValue = weekdays[0]; //Assert Assert.AreEqual(expectedValue, actualValue); }
public void Zipper_Zipped_Yes() { //Arrange CustomList <int> numbers1 = new CustomList <int>() { 1, 3 }; CustomList <int> numbers2 = new CustomList <int>() { 2, 4, 6, 8, 10 }; CustomList <int> primes = new CustomList <int>(); int expectedValue = 10; int actualValue; //Act primes = numbers1.Zip(numbers2); actualValue = primes[6]; //Assert Assert.AreEqual(expectedValue, actualValue); }