Exemplo n.º 1
0
        public void Zip_ZippingTwoListsWithTwoItems_FirstItemShouldBeFirstItemInTheFirstList()
        {
            // arrange
            CustomClassList <int> test1  = new CustomClassList <int>();
            CustomClassList <int> test2  = new CustomClassList <int>();
            CustomClassList <int> result = new CustomClassList <int>();

            test1.Add(0);
            test1.Add(2);
            test2.Add(1);
            test2.Add(3);
            int expected = 0;
            int actual;

            // act
            result = test1.Zip(test2);
            actual = result[0];

            // assert
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 2
0
        public void Zip_TwoListsWithTwoItems_SecondItemInTheResultListShouldBeTheFirstItemInTheSecondList()
        {
            // arrange
            CustomClassList <int> test1  = new CustomClassList <int>();
            CustomClassList <int> test2  = new CustomClassList <int>();
            CustomClassList <int> result = new CustomClassList <int>();

            test1.Add(0);
            test1.Add(2);
            test2.Add(1);
            test2.Add(3);
            int expected = 1;
            int actual;

            // act
            result = test1.Zip(test2);
            actual = result[1];

            // assert
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 3
0
        public void Zip_FirstListHasTwoSecondListHasThreeItems_ResultListsFourthItemShouldBeSecondListsSecondItem()
        {
            // arrange
            CustomClassList <int> test1  = new CustomClassList <int>();
            CustomClassList <int> test2  = new CustomClassList <int>();
            CustomClassList <int> result = new CustomClassList <int>();

            test1.Add(0);
            test1.Add(2);
            test2.Add(1);
            test2.Add(3);
            test2.Add(4);
            int expected = 3;
            int actual;

            // act
            result = test1.Zip(test2);
            actual = result[3];

            // assert
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 4
0
        public void Zip_SecondListHasMoreItems_ExtraItemsShouldBeAddedAtTheEndOfTheResultList()
        {
            // arrange
            CustomClassList <int> test1  = new CustomClassList <int>();
            CustomClassList <int> test2  = new CustomClassList <int>();
            CustomClassList <int> result = new CustomClassList <int>();

            test1.Add(0);
            test1.Add(2);
            test2.Add(1);
            test2.Add(3);
            test2.Add(5);
            test2.Add(7);
            int expected = 7;
            int actual;

            // act
            result = test1.Zip(test2);
            actual = result[5];

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