Browse Source

fix build

pull/6/merge
Siegfried Pammer 14 years ago
parent
commit
eb152e33a5
  1. 2
      src/AddIns/DisplayBindings/XmlEditor/Test/Completion/ProcessKeyTests.cs
  2. 8
      src/AddIns/DisplayBindings/XmlEditor/Test/Utils/MockDocument.cs
  3. 3
      src/AddIns/DisplayBindings/XmlEditor/Test/Utils/MockTextEditor.cs

2
src/AddIns/DisplayBindings/XmlEditor/Test/Completion/ProcessKeyTests.cs

@ -24,7 +24,7 @@ namespace XmlEditor.Tests.Completion
[Test] [Test]
public void ProcessInputWithSpaceCharReturnsNormalKey() public void ProcessInputWithSpaceCharReturnsNormalKey()
{ {
Assert.AreEqual(CompletionItemListKeyResult.NormalKey, completionItems.ProcessInput(' ')); Assert.AreEqual(CompletionItemListKeyResult.InsertionKey, completionItems.ProcessInput(' '));
} }
[Test] [Test]

8
src/AddIns/DisplayBindings/XmlEditor/Test/Utils/MockDocument.cs

@ -18,10 +18,12 @@ namespace XmlEditor.Tests.Utils
public List<int> PositionToOffsetReturnValues = new List<int>(); public List<int> PositionToOffsetReturnValues = new List<int>();
public MockDocument() MockTextEditor editor;
public MockDocument(MockTextEditor editor = null)
{ {
this.editor = editor;
} }
public event EventHandler TextChanged; public event EventHandler TextChanged;
protected virtual void OnTextChanged(EventArgs e) protected virtual void OnTextChanged(EventArgs e)
@ -77,6 +79,8 @@ namespace XmlEditor.Tests.Utils
public void Insert(int offset, string text) public void Insert(int offset, string text)
{ {
this.text = this.text.Insert(offset, text); this.text = this.text.Insert(offset, text);
if (editor != null && editor.Caret.Offset == offset)
editor.Caret.Offset += text.Length;
} }
public void Insert(int offset, string text, AnchorMovementType defaultAnchorMovementType) public void Insert(int offset, string text, AnchorMovementType defaultAnchorMovementType)

3
src/AddIns/DisplayBindings/XmlEditor/Test/Utils/MockTextEditor.cs

@ -16,7 +16,7 @@ namespace XmlEditor.Tests.Utils
MockCompletionListWindow completionWindowDisplayed; MockCompletionListWindow completionWindowDisplayed;
ICompletionItemList completionItemsDisplayed; ICompletionItemList completionItemsDisplayed;
MockCaret caret = new MockCaret(); MockCaret caret = new MockCaret();
IDocument document = new MockDocument(); IDocument document;
ITextEditorOptions options = new MockTextEditorOptions(); ITextEditorOptions options = new MockTextEditorOptions();
FileName fileName; FileName fileName;
bool showCompletionWindowReturnsNull; bool showCompletionWindowReturnsNull;
@ -26,6 +26,7 @@ namespace XmlEditor.Tests.Utils
public MockTextEditor() public MockTextEditor()
{ {
document = new MockDocument(this);
} }
public event EventHandler SelectionChanged; public event EventHandler SelectionChanged;

Loading…
Cancel
Save