Exemplo n.º 1
0
        public void IsComplexTextAppendableTo()
        {
            var text = "abc";
            var head = new SimpleText(text, 0, 1);
            var tail = new ComplexText(new[] { new SimpleText(text, 2, 1) });

            Assert.IsFalse(head.IsComplexTextAppendableTo(tail));

            text = "abc";
            head = new SimpleText(text, 0, 2);
            tail = new ComplexText(new[] { new SimpleText(text, 1, 2) });
            Assert.IsFalse(head.IsComplexTextAppendableTo(tail));

            text = "abc";
            head = new SimpleText(text, 0, 1);
            tail = new ComplexText(new[] { new SimpleText(text, 1, 2) });
            Assert.IsTrue(head.IsComplexTextAppendableTo(tail));

            text = "abc";
            head = new SimpleText(text, 0, 2);
            tail = new ComplexText(new[] { new SimpleText(text, 2, 1) });
            Assert.IsTrue(head.IsComplexTextAppendableTo(tail));
        }
        public void IsComplexTextAppendableTo()
        {
            var text = "abc";
            var head = new SimpleText(text, 0, 1);
            var tail = new ComplexText(new[] { new SimpleText(text, 2, 1) });
            Assert.IsFalse(head.IsComplexTextAppendableTo(tail));

            text = "abc";
            head = new SimpleText(text, 0, 2);
            tail = new ComplexText(new[] { new SimpleText(text, 1, 2) });
            Assert.IsFalse(head.IsComplexTextAppendableTo(tail));

            text = "abc";
            head = new SimpleText(text, 0, 1);
            tail = new ComplexText(new[] { new SimpleText(text, 1, 2) });
            Assert.IsTrue(head.IsComplexTextAppendableTo(tail));

            text = "abc";
            head = new SimpleText(text, 0, 2);
            tail = new ComplexText(new[] { new SimpleText(text, 2, 1) });
            Assert.IsTrue(head.IsComplexTextAppendableTo(tail));
        }