You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.1 KiB
47 lines
1.1 KiB
// <file> |
|
// <copyright see="prj:///doc/copyright.txt"/> |
|
// <license see="prj:///doc/license.txt"/> |
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/> |
|
// <version>$Revision$</version> |
|
// </file> |
|
|
|
using System; |
|
using ICSharpCode.AvalonEdit; |
|
using ICSharpCode.AvalonEdit.Editing; |
|
using ICSharpCode.RubyBinding; |
|
using NUnit.Framework; |
|
|
|
namespace RubyBinding.Tests.Console |
|
{ |
|
[TestFixture] |
|
public class InsertConsoleCompletionDataTestFixture |
|
{ |
|
RubyConsoleCompletionData completionData; |
|
TextEditor textEditor; |
|
|
|
[SetUp] |
|
public void Init() |
|
{ |
|
textEditor = new TextEditor(); |
|
} |
|
|
|
[Test] |
|
public void TextInsertedAtCursor() |
|
{ |
|
textEditor.Text = "abc.n"; |
|
textEditor.CaretOffset = 4; |
|
|
|
int startOffset = 4; |
|
int endOffset = 5; |
|
SimpleSelection selection = new SimpleSelection(startOffset, endOffset); |
|
|
|
completionData = new RubyConsoleCompletionData("new"); |
|
completionData.Complete(textEditor.TextArea, selection, null); |
|
|
|
string expectedText = |
|
"abc.new"; |
|
|
|
Assert.AreEqual(expectedText, textEditor.Text); |
|
} |
|
} |
|
}
|
|
|