Ejemplo n.º 1
0
        public void TestDocumentBug2Test()
        {
            IDocument document = new DocumentFactory().CreateDocument();

            string top      = "123\n456\n789\n0";
            string testText = "Hello World!";

            document.TextContent = top;

            document.Insert(top.Length, testText);

            LineSegment line = document.GetLineSegment(document.TotalNumberOfLines - 1);

            Assert.AreEqual(top.Length - 1, line.Offset);
            Assert.AreEqual(testText.Length + 1, line.Length);
        }
		public void TestDocumentInsertTest()
		{
			IDocument document = new DocumentFactory().CreateDocument();
			
			string top      = "1234567890\n";
			string testText =
			"12345678\n" +
			"1234567\n" +
			"123456\n" +
			"12345\n" +
			"1234\n" +
			"123\n" +
			"12\n" +
			"1\n" +
			"\n";
			
			document.TextContent = top;
			document.Insert(top.Length, testText);
			Assert.AreEqual(top + testText, document.TextContent);
		}