Esempio n. 1
0
        public void InsertSameElement_ReturnsSameNode()
        {
            const int item = 10;
            var       node = new TwoNode <int>(item, EmptyTwoThree <int> .Instance, EmptyTwoThree <int> .Instance);

            int             splitValue;
            ITwoThree <int> splitLeft, splitRight;
            var             result = node.Insert(item, Comparer <int> .Default, out splitLeft, out splitRight, out splitValue);

            Assert.AreSame(node, result);
        }
Esempio n. 2
0
        public void InsertNewElement_ReturnsThreeNode()
        {
            const int first = 10, second = 20;
            var       node = new TwoNode <int>(first, EmptyTwoThree <int> .Instance, EmptyTwoThree <int> .Instance);

            int             splitValue;
            ITwoThree <int> splitLeft, splitRight;
            var             result = node.Insert(second, Comparer <int> .Default, out splitLeft, out splitRight, out splitValue);

            Assert.IsNotNull(result);
            Assert.IsInstanceOf <ThreeNode <int> >(result);
        }