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

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

@ -18,10 +18,12 @@ namespace XmlEditor.Tests.Utils @@ -18,10 +18,12 @@ namespace XmlEditor.Tests.Utils
public List<int> PositionToOffsetReturnValues = new List<int>();
public MockDocument()
MockTextEditor editor;
public MockDocument(MockTextEditor editor = null)
{
this.editor = editor;
}
public event EventHandler TextChanged;
protected virtual void OnTextChanged(EventArgs e)
@ -77,6 +79,8 @@ namespace XmlEditor.Tests.Utils @@ -77,6 +79,8 @@ namespace XmlEditor.Tests.Utils
public void Insert(int offset, string 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)

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

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

Loading…
Cancel
Save