Example #1
0
        public void LinkedListSingleLinkSplit1BruteForceCompleteTestEmptyList()
        {
            // Split the list.
            LinkedListSingleLinkSplit1BruteForceComplete.Split(null, out LinkedListSingleLinkNode <int> ResultA, out LinkedListSingleLinkNode <int> ResultB, out LinkedListSingleLinkNode <int> ResultDropped);

            // Do the compare.
            Assert.IsTrue(LinkedListSingleLinkNode <int> .Compare(ResultA, null));
            Assert.IsTrue(LinkedListSingleLinkNode <int> .Compare(ResultB, null));
            Assert.IsTrue(LinkedListSingleLinkNode <int> .Compare(ResultDropped, null));
        }
Example #2
0
        public void LinkedListSingleLinkSplit1BruteForceCompleteTestSingleElement()
        {
            // First list.
            var toSplit = LinkedListSingleLinkNode <int> .CreateFromData(3);

            // Expected A (1st half of list)
            var expectedDropped = LinkedListSingleLinkNode <int> .CreateFromData(3);

            // Split the list.
            LinkedListSingleLinkSplit1BruteForceComplete.Split(toSplit, out LinkedListSingleLinkNode <int> ResultA, out LinkedListSingleLinkNode <int> ResultB, out LinkedListSingleLinkNode <int> ResultDropped);

            // Do the compare.
            Assert.IsTrue(LinkedListSingleLinkNode <int> .Compare(ResultA, null));
            Assert.IsTrue(LinkedListSingleLinkNode <int> .Compare(ResultB, null));
            Assert.IsTrue(LinkedListSingleLinkNode <int> .Compare(ResultDropped, expectedDropped));
        }
Example #3
0
        public void LinkedListSingleLinkSplit1BruteForceCompleteTestSimpleEven()
        {
            // First list.
            var a = LinkedListSingleLinkNode <int> .CreateFromData(1, 2, 3, 4);

            // Expected A (1st half of list)
            var expectedA = LinkedListSingleLinkNode <int> .CreateFromData(1, 2);

            // Expected B (2nd half of list)
            var expectedB = LinkedListSingleLinkNode <int> .CreateFromData(3, 4);

            // Split the list.
            LinkedListSingleLinkSplit1BruteForceComplete.Split(a, out LinkedListSingleLinkNode <int> ResultA, out LinkedListSingleLinkNode <int> ResultB, out LinkedListSingleLinkNode <int> ResultDropped);

            // Do the compare.
            Assert.IsTrue(LinkedListSingleLinkNode <int> .Compare(ResultA, expectedA));
            Assert.IsTrue(LinkedListSingleLinkNode <int> .Compare(ResultB, expectedB));
            Assert.IsTrue(LinkedListSingleLinkNode <int> .Compare(ResultDropped, null));
        }