protected void TestKeyPress(string fileHeader, string fileFooter, char keyPressed, CodeCompletionKeyPressResult keyPressResult, Action<ICompletionItemList> constraint)
		{
			this.textEditor.Document.Text = fileHeader + fileFooter;
			this.textEditor.Caret.Offset = fileHeader.Length;
			this.textEditor.CreateParseInformation();
			
			CodeCompletionKeyPressResult result = new VBNetCompletionBinding().HandleKeyPress(textEditor, keyPressed);
			
			Assert.AreEqual(keyPressResult, result);
			
			ICompletionItemList list = this.textEditor.LastCompletionItemList;
			
			constraint(list);
		}
		protected void TestCtrlSpace(string fileHeader, string fileFooter, bool expected, Action<ICompletionItemList> constraint)
		{
			this.textEditor.Document.Text = fileHeader + fileFooter;
			this.textEditor.Caret.Offset = fileHeader.Length;
			this.textEditor.CreateParseInformation();
			
			bool invoked = new VBNetCompletionBinding().CtrlSpace(textEditor);
			
			Assert.AreEqual(expected, invoked);
			
			ICompletionItemList list = this.textEditor.LastCompletionItemList;
			
			constraint(list);
		}
Esempio n. 3
0
		protected void TestKeyPress(string file, char keyPressed, CodeCompletionKeyPressResult keyPressResult, Action<ICompletionItemList> constraint)
		{
			int insertionPoint = file.IndexOf('|');
			
			if (insertionPoint < 0)
				Assert.Fail("insertionPoint not found in text!");
			
			this.textEditor.Document.Text = file.Replace("|", "");
			this.textEditor.Caret.Offset = insertionPoint;
			this.textEditor.CreateParseInformation();
			
			CodeCompletionKeyPressResult result = new VBNetCompletionBinding().HandleKeyPress(textEditor, keyPressed);
			
			Assert.AreEqual(keyPressResult, result);
			
			ICompletionItemList list = this.textEditor.LastCompletionItemList;
			
			constraint(list);
		}
Esempio n. 4
0
		protected void TestCtrlSpace(string file, bool expected, Action<ICompletionItemList> constraint)
		{
			int insertionPoint = file.IndexOf('|');
			
			if (insertionPoint < 0)
				Assert.Fail("insertionPoint not found in text!");
			
			this.textEditor.Document.Text = file.Replace("|", "");
			this.textEditor.Caret.Offset = insertionPoint;
			this.textEditor.CreateParseInformation();
			
			bool invoked = new VBNetCompletionBinding().CtrlSpace(textEditor);
			
			Assert.AreEqual(expected, invoked);
			
			ICompletionItemList list = this.textEditor.LastCompletionItemList;
			
			constraint(list);
		}
        protected void TestKeyPress(string file, char keyPressed, CodeCompletionKeyPressResult keyPressResult, Action <ICompletionItemList> constraint)
        {
            int insertionPoint = file.IndexOf('|');

            if (insertionPoint < 0)
            {
                Assert.Fail("insertionPoint not found in text!");
            }

            this.textEditor.Document.Text = file.Replace("|", "");
            this.textEditor.Caret.Offset  = insertionPoint;
            this.textEditor.CreateParseInformation();

            CodeCompletionKeyPressResult result = new VBNetCompletionBinding().HandleKeyPress(textEditor, keyPressed);

            Assert.AreEqual(keyPressResult, result);

            ICompletionItemList list = this.textEditor.LastCompletionItemList;

            constraint(list);
        }
        protected void TestCtrlSpace(string file, bool expected, Action <ICompletionItemList> constraint)
        {
            int insertionPoint = file.IndexOf('|');

            if (insertionPoint < 0)
            {
                Assert.Fail("insertionPoint not found in text!");
            }

            this.textEditor.Document.Text = file.Replace("|", "");
            this.textEditor.Caret.Offset  = insertionPoint;
            this.textEditor.CreateParseInformation();

            bool invoked = new VBNetCompletionBinding().CtrlSpace(textEditor);

            Assert.AreEqual(expected, invoked);

            ICompletionItemList list = this.textEditor.LastCompletionItemList;

            constraint(list);
        }