Ejemplo n.º 1
0
        public void AppendSimpleText()
        {
            var text   = "abc";
            var head   = new SimpleText(text, 0, 1);
            var tail   = new SimpleText(text, 2, 1);
            var result = head.AppendSimpleText(tail);

            Assert.IsTrue(result == "ac");
            Assert.IsFalse(result is SimpleText);

            text   = "abc";
            head   = new SimpleText(text, 0, 2);
            tail   = new SimpleText(text, 1, 2);
            result = head.AppendSimpleText(tail);
            Assert.IsTrue(result == "abbc");
            Assert.IsFalse(result is SimpleText);

            text   = "abc";
            head   = new SimpleText(text, 0, 1);
            tail   = new SimpleText(text, 1, 2);
            result = head.AppendSimpleText(tail);
            Assert.IsTrue(result == "abc");
            Assert.IsTrue(result is SimpleText);

            text   = "abc";
            head   = new SimpleText(text, 0, 2);
            tail   = new SimpleText(text, 2, 1);
            result = head.AppendSimpleText(tail);
            Assert.IsTrue(result == "abc");
            Assert.IsTrue(result is SimpleText);
        }
        public void AppendSimpleText()
        {
            var text = "abc";
            var head = new SimpleText(text, 0, 1);
            var tail = new SimpleText(text, 2, 1);
            var result = head.AppendSimpleText(tail);
            Assert.IsTrue(result == "ac");
            Assert.IsFalse(result is SimpleText);

            text = "abc";
            head = new SimpleText(text, 0, 2);
            tail = new SimpleText(text, 1, 2);
            result = head.AppendSimpleText(tail);
            Assert.IsTrue(result == "abbc");
            Assert.IsFalse(result is SimpleText);

            text = "abc";
            head = new SimpleText(text, 0, 1);
            tail = new SimpleText(text, 1, 2);
            result = head.AppendSimpleText(tail);
            Assert.IsTrue(result == "abc");
            Assert.IsTrue(result is SimpleText);

            text = "abc";
            head = new SimpleText(text, 0, 2);
            tail = new SimpleText(text, 2, 1);
            result = head.AppendSimpleText(tail);
            Assert.IsTrue(result == "abc");
            Assert.IsTrue(result is SimpleText);
        }