Beispiel #1
0
        public void Test_OfTwoCustomListZIP()
        {
            //Arrange
            NewCustomList <int> oddlist = new NewCustomList <int>()
            {
                1, 3, 5
            };
            NewCustomList <int> evenlist = new NewCustomList <int>()
            {
                2, 4, 6
            };

            //Act
            NewCustomList <int> expectedresult = new NewCustomList <int>()
            {
                1, 2, 3, 4, 5, 6
            };
            NewCustomList <int> actual = NewCustomList <int> .Zip(oddlist, evenlist);

            //Assert
            Assert.AreEqual(expectedresult.ToString(), actual.ToString());
        }
Beispiel #2
0
        public void Zip_CanZipListString()
        {
            //Arrange
            NewCustomList <string> mylist = new NewCustomList <string>()
            {
                "Sunny", "Rain", "Sleet"
            };
            NewCustomList <string> mylist2 = new NewCustomList <string>()
            {
                "Windy", "Wet", "Stormy"
            };
            NewCustomList <string> expected = new NewCustomList <string>()
            {
                "Sunny", "Windy", "Rain", "Wet", "Sleet", "Stormy"
            };
            NewCustomList <string> actual;

            //Act
            actual = NewCustomList <string> .Zip(mylist, mylist2);

            //Assert
            Assert.AreEqual(expected.ToString(), actual.ToString());
        }
Beispiel #3
0
        public void Zip_CanZipListInt()
        {
            //Arrange
            NewCustomList <int> mylist = new NewCustomList <int>()
            {
                1, 2, 3
            };
            NewCustomList <int> mylist2 = new NewCustomList <int>()
            {
                4, 5, 6
            };
            NewCustomList <int> expected = new NewCustomList <int>()
            {
                1, 4, 2, 5, 3, 6
            };
            NewCustomList <int> actual;

            //Act
            actual = NewCustomList <int> .Zip(mylist, mylist2);

            //Assert
            Assert.AreEqual(expected.ToString(), actual.ToString());
        }
Beispiel #4
0
        public void Zip_CanZipListDpouble()
        {
            //Arrange
            NewCustomList <double> mylist = new NewCustomList <double>()
            {
                1.1, 1.2, 1.3, 1.4
            };
            NewCustomList <double> mylist2 = new NewCustomList <double>()
            {
                1.5, 1.6
            };
            NewCustomList <double> expected = new NewCustomList <double>()
            {
                1.1, 1.5, 1.2, 1.6, 1.3, 1.4
            };
            NewCustomList <double> actual;

            //Act

            actual = NewCustomList <double> .Zip(mylist, mylist2);

            //Assert
            Assert.AreEqual(expected.ToString(), actual.ToString());
        }