Пример #1
0
        [TestMethod]//23
        public void Zip_CheckArrayOrder_TwoListsOfInts()
        {
            // arrange

            ListB <int> listB      = new ListB <int>();
            ListB <int> listA      = new ListB <int>();
            ListB <int> zippedList = new ListB <int>();
            int         expected   = 5;
            int         actual;

            //act
            listB.Add(1);
            listB.Add(7);
            listB.Add(9);
            listB.Add(2);
            listA.Add(4);
            listA.Add(8);
            listA.Add(5);
            listA.Add(6);
            listA.Add(5);

            zippedList = listB.Zip(listA);



            actual = zippedList[5];


            //assert
            Assert.AreEqual(expected, actual);
        }
Пример #2
0
        [TestMethod]//22
        public void Zip_CheckCount_TwoListsOfStrings()
        {
            // arrange

            ListB <string> listB      = new ListB <string>();
            ListB <string> listA      = new ListB <string>();
            ListB <string> zippedList = new ListB <string>();
            int            expected   = 9;
            int            actual;

            //act
            listB.Add("A");
            listB.Add("A");
            listB.Add("A");
            listB.Add("A");
            listA.Add("A");
            listA.Add("A");
            listA.Add("A");
            listA.Add("A");
            listA.Add("A");

            zippedList = listB.Zip(listA);



            actual = zippedList.Count;


            //assert
            Assert.AreEqual(expected, actual);
        }
Пример #3
0
        [TestMethod]//23
        public void Zip_CheckArrayOrder_TwoListsOfStrings()
        {
            // arrange

            ListB <string> listB      = new ListB <string>();
            ListB <string> listA      = new ListB <string>();
            ListB <string> zippedList = new ListB <string>();
            string         expected   = "R";
            string         actual;

            //act
            listB.Add("A");
            listB.Add("B");
            listB.Add("C");
            listB.Add("D");
            listA.Add("Z");
            listA.Add("R");
            listA.Add("S");
            listA.Add("T");
            listA.Add("U");

            zippedList = listB.Zip(listA);



            actual = zippedList[3];


            //assert
            Assert.AreEqual(expected, actual);
        }
Пример #4
0
        [TestMethod]//21
        public void Zip_CheckCount_TwoListsOfInts()
        {
            // arrange

            ListB <int> listB      = new ListB <int>();
            ListB <int> listA      = new ListB <int>();
            ListB <int> zippedList = new ListB <int>();
            int         expected   = 9;
            int         actual;

            //act
            listB.Add(1);
            listB.Add(2);
            listB.Add(3);
            listB.Add(5);
            listA.Add(1);
            listA.Add(4);
            listA.Add(5);
            listA.Add(6);
            listA.Add(7);

            zippedList = listB.Zip(listA);



            actual = zippedList.Count;


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