示例#1
0
        public void Empty_Lists_Passed_In_As_Argument()
        {
            LinkedList <int> listA = new LinkedList <int>();
            LinkedList <int> listB = new LinkedList <int>();

            Node <int> testReference = LLZip.ZipList(listA, listB);

            Assert.Null(testReference);
        }
示例#2
0
        public void Zip_List_Can_Combine_Uneven_length_Lists_When_ListB_Is_Longer()
        {
            LinkedList <int> listA = MakeList(3, 0);
            LinkedList <int> listB = MakeList(6, 1);

            Node <int>       testListHead = LLZip.ZipList(listA, listB);
            LinkedList <int> testList     = new LinkedList <int>(testListHead);

            string result = testList.ToString();

            string expected = "[0] => [1] => [0] => [1] => [0] => [1] => [1] => [1] => [1] => Null";

            Assert.Equal(expected, result);
        }
示例#3
0
        public void Zip_List_Happy_Paths_Returning_As_Expected_Even_Length_Lists()
        {
            LinkedList <int> listA = new LinkedList <int>();

            listA.Append(1);
            listA.Append(3);
            listA.Append(5);

            LinkedList <int> listB = new LinkedList <int>();

            listB.Append(2);
            listB.Append(4);
            listB.Append(6);

            Node <int>       testListHead = LLZip.ZipList(listA, listB);
            LinkedList <int> testList     = new LinkedList <int>(testListHead);


            string result = testList.ToString();

            string expected = "[1] => [2] => [3] => [4] => [5] => [6] => Null";

            Assert.Equal(expected, result);
        }