Exemplo n.º 1
0
        public void ItInsertsAndRemovesMultipleTexts()
        {
            var tbl = new PieceTable();

            tbl.Insert("Hello world", 0);
            tbl.Insert(" asdasd wonderful", 5);
            tbl.Insert(", this is a ajslkdhk test!", tbl.ToString().Length);
            tbl.Remove(5, 7);
            tbl.Remove(33, "ajslkdhk ".Length);

            Assert.AreEqual("Hello wonderful world, this is a test!", tbl.ToString());
        }
Exemplo n.º 2
0
        public void ItRemovesTextAtTheEnd()
        {
            var tbl = new PieceTable("Hello worldasdasd");

            tbl.Remove(11, 6);

            Assert.AreEqual("Hello world", tbl.ToString());
        }
Exemplo n.º 3
0
        public void ItRemovesTextAtTheBeginning()
        {
            var tbl = new PieceTable("asdasd Hello world");

            tbl.Remove(0, 7);

            Assert.AreEqual("Hello world", tbl.ToString());
        }
Exemplo n.º 4
0
        public void ItRemovesText()
        {
            var tbl = new PieceTable("Hello asdasd world");

            tbl.Remove(6, 7);

            Assert.AreEqual("Hello world", tbl.ToString());
        }