// // // // // $Revision$ // 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); } } }