diff --git a/src/AddIns/BackendBindings/XamlBinding/XamlBinding.Tests/CodeCompletionTests.cs b/src/AddIns/BackendBindings/XamlBinding/XamlBinding.Tests/CodeCompletionTests.cs
index 0bccd30034..68eae4c6ff 100644
--- a/src/AddIns/BackendBindings/XamlBinding/XamlBinding.Tests/CodeCompletionTests.cs
+++ b/src/AddIns/BackendBindings/XamlBinding/XamlBinding.Tests/CodeCompletionTests.cs
@@ -6,6 +6,7 @@
//
using System;
+using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
@@ -507,7 +508,7 @@ namespace ICSharpCode.XamlBinding.Tests
xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'>
+ string fileFooter = @"' />
";
@@ -677,16 +678,16 @@ namespace ICSharpCode.XamlBinding.Tests
xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'>
+ string fileFooter = @"' />
";
TestKeyPress(fileHeader, fileFooter, 'a', CodeCompletionKeyPressResult.None,
- list => {
- Assert.AreEqual(0, list.PreselectionLength);
- Assert.IsNull(list.SuggestedItem);
- Assert.IsTrue(!list.Items.Any());
- });
+ list => {
+ Assert.AreEqual(0, list.PreselectionLength);
+ Assert.IsNull(list.SuggestedItem);
+ Assert.IsTrue(!list.Items.Any());
+ });
}
[Test]
diff --git a/src/AddIns/BackendBindings/XamlBinding/XamlBinding.Tests/CodeInsertionTests.cs b/src/AddIns/BackendBindings/XamlBinding/XamlBinding.Tests/CodeInsertionTests.cs
new file mode 100644
index 0000000000..64fcbe9fc5
--- /dev/null
+++ b/src/AddIns/BackendBindings/XamlBinding/XamlBinding.Tests/CodeInsertionTests.cs
@@ -0,0 +1,92 @@
+//
+//
+//
+//
+// $Revision: 5529 $
+//
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+
+using ICSharpCode.SharpDevelop.Editor.CodeCompletion;
+using NUnit.Framework;
+
+namespace ICSharpCode.XamlBinding.Tests
+{
+ [TestFixture]
+ [RequiresSTA]
+ public class CodeInsertionTests : TextEditorBasedTests
+ {
+ #region TextInsertionTests
+ [Test]
+ public void CtrlSpaceClosingAttributeValueWithEqualsInsertionTest()
+ {
+ string fileHeader = @"
+
+ ";
+
+ TestCtrlSpace(fileHeader, fileFooter, true,
+ list => {
+ Assert.AreEqual(0, list.PreselectionLength);
+ Assert.IsNull(list.SuggestedItem);
+ Assert.IsTrue(list.Items.Any());
+
+ TestTextInsert(fileHeader, fileFooter, '=', list, list.Items.First(i => i.Text == "Content"), "Content=\"\"", "Content=\"".Length);
+ });
+ }
+
+ [Test]
+ public void CtrlSpaceInsertionTest()
+ {
+ string fileHeader = @"
+
+ ";
+ string fileFooter = @"
+
+ ";
+
+ TestCtrlSpace(fileHeader, fileFooter, true,
+ list => {
+ Assert.AreEqual(0, list.PreselectionLength);
+ Assert.IsNull(list.SuggestedItem);
+ Assert.IsTrue(list.Items.Any());
+
+ TestTextInsert(fileHeader, fileFooter, '\n', list, list.Items.First(i => i.Text == "!--"), "", "