示例#1
0
        public void DeleteSelection()
        {
            var engine = new TextEngine(new List <string> ()
            {
                "это тест", "это еще один тест"
            });

            engine.SetCursorPosition(new TextPosition(0, 2), true);
            engine.PerformDown(true);
            engine.PerformDelete();

            Assert.AreEqual(1, engine.LineCount);
            Assert.AreEqual(LinesToString(new string[] { "это еще один тест" }),
                            engine.ToString());
            Assert.AreEqual(new TextPosition(0, 2), engine.CurrentPosition);
        }
示例#2
0
        public void DeleteMultiLineSelection()
        {
            var engine = new TextEngine(new List <string> ()
            {
                "line 1", "line 2", "line 3"
            });

            engine.SetCursorPosition(new TextPosition(0, 2), true);
            engine.PerformDown(true);
            engine.PerformDown(true);
            engine.PerformDelete();

            Assert.AreEqual(1, engine.LineCount);
            Assert.AreEqual(LinesToString(new string[] { "line 3" }),
                            engine.ToString());
        }