예제 #1
0
 public void Test_RefreshNotEmptyAndSelected()
 {
     ICSharpCode.TextEditor.TextEditorControl textEditorControl = new ICSharpCode.TextEditor.TextEditorControl();
     textEditorControl.Text = "refresh";
     textEditorTextContext = new TextEditorTextContext(textEditorControl);
     textEditorTextContext.SetSelection(1,3);
     Assert.AreEqual("refresh", textEditorTextContext.Data, "Initial Data is not equal to argument string!");
     Assert.AreEqual(1, textEditorTextContext.SelectionStart, "SelectionStart not 1!");
     Assert.AreEqual(3, textEditorTextContext.SelectionEnd, "SelectionEnd not 3!");
     Assert.AreEqual("ef", textEditorTextContext.SelectedText, "Initial SelectedText not empty!");
     textEditorTextContext.Refresh();
     Assert.AreEqual("refresh", textEditorTextContext.Data, "Initial Data is not empty after Refresh!");
     Assert.AreEqual(1, textEditorTextContext.SelectionStart, "SelectionStart not 1 after Refresh!");
     Assert.AreEqual(3, textEditorTextContext.SelectionEnd, "SelectionEnd not 3 after Refresh!");
     Assert.AreEqual("ef", textEditorTextContext.SelectedText, "Initial SelectedText not empty after Refresh!");
 }
예제 #2
0
 public void Test_RefreshNotEmpty()
 {
     ICSharpCode.TextEditor.TextEditorControl textEditorControl = new ICSharpCode.TextEditor.TextEditorControl();
     textEditorControl.Text = "refresh";
     textEditorTextContext = new TextEditorTextContext(textEditorControl);
     Assert.AreEqual("refresh", textEditorTextContext.Data, "Initial Data is not equal to argument string!");
     Assert.AreEqual(0, textEditorTextContext.SelectionStart, "Initial SelectionStart not 0!");
     Assert.AreEqual(0, textEditorTextContext.SelectionEnd, "Initial SelectionEnd not 0!");
     Assert.AreEqual("", textEditorTextContext.SelectedText, "Initial SelectedText not empty!");
     textEditorTextContext.Refresh();
     Assert.AreEqual("refresh", textEditorTextContext.Data, "Initial Data is not equal to argumetn string after Refresh!");
     Assert.AreEqual(0, textEditorTextContext.SelectionStart, "Initial SelectionStart not 0 after Refresh!");
     Assert.AreEqual(0, textEditorTextContext.SelectionEnd, "Initial SelectionEnd not 0 after Refresh!");
     Assert.AreEqual("", textEditorTextContext.SelectedText, "Initial SelectedText not empty after Refresh!");
 }