Exemple #1
0
        public void ZipList_CheckToSeeIfPlacedInProperIndex()
        {
            CustomList <int> listOne = new CustomList <int> {
                1, 2
            };
            CustomList <int> listTwo = new CustomList <int> {
                3, 4
            };

            CustomList <int> zipList = listOne + listTwo;

            listOne.ZipList(listOne, listTwo);
            listTwo.ZipList(listOne, listTwo);

            Assert.AreEqual(2, zipList[2]);
            Assert.AreEqual(3, zipList[1]);
        }
        public void ZipTestString()
        {
            //Arrange
            CustomList <string> even   = new CustomList <string>();
            CustomList <string> odd    = new CustomList <string>();
            CustomList <string> result = new CustomList <string>();


            //Act

            odd.Add("First");
            odd.Add("Third");
            even.Add("Second");
            even.Add("Fourth");

            result = even.ZipList(odd);
            //Assert
            Assert.AreEqual(result.ToString(), "FirstSecondThirdFourth");
        }
        public void ZipTestInt()
        {
            //Arrange
            CustomList <int> even   = new CustomList <int>();
            CustomList <int> odd    = new CustomList <int>();
            CustomList <int> result = new CustomList <int>();

            //Act

            odd.Add(1);
            odd.Add(3);
            odd.Add(5);
            even.Add(2);
            even.Add(4);
            even.Add(6);

            result = even.ZipList(odd);

            //Assert
            Assert.AreEqual(4, result[3]);
        }