public void Init()
		{
			base.InitBase();
			
			XmlCodeCompletionBinding completionBinding = new XmlCodeCompletionBinding(associations);
			keyPressResult = completionBinding.HandleKeyPress(textEditor, '=');			
		}
        public void CompletionBindingHandleKeyPressDoesNotThrowNullReferenceException()
        {
            base.InitBase();

            textEditor.ShowCompletionWindowReturnsNull = true;

            XmlCodeCompletionBinding completionBinding = new XmlCodeCompletionBinding(associations);
            Assert.DoesNotThrow(delegate { keyPressResult = completionBinding.HandleKeyPress(textEditor, '='); });
        }
        public void Init()
        {
            schemas = new XmlSchemaCompletionCollection();

            XmlSchemaFileAssociations associations = new XmlSchemaFileAssociations(new Properties(), new DefaultXmlSchemaFileAssociations(new AddInTreeNode()), schemas);

            textEditor = new MockTextEditor();
            textEditor.FileName = new FileName(@"c:\projects\test.xsd");
            textEditor.Document.Text = "";
            textEditor.Caret.Offset = 0;

            completionBinding = new XmlCodeCompletionBinding(associations);
        }
		public void Init()
		{
			XmlSchemaCompletionCollection schemas = new XmlSchemaCompletionCollection();
			associations = new XmlSchemaFileAssociations(new Properties(), new DefaultXmlSchemaFileAssociations(new AddInTreeNode()), schemas);
			
			textEditor = new MockTextEditor();
			textEditor.FileName = new FileName(@"c:\projects\test.xsd");
			textEditor.Document.Text = "<xs:schema elementFormDefault=\"\"></xs:schema>";
			
			// Put cursor inside the double quotes following the elementFormDefault attribute
			textEditor.Caret.Offset = 31;	
			
			completionBinding = new XmlCodeCompletionBinding(associations);
			result = completionBinding.CtrlSpace(textEditor);
		}
		public void Init()
		{
			schemas = new XmlSchemaCompletionCollection();
			schemas.Add(new XmlSchemaCompletion(ResourceManager.ReadXhtmlStrictSchema()));

			XmlSchemaFileAssociations associations = new XmlSchemaFileAssociations(new Properties(), new DefaultXmlSchemaFileAssociations(new AddInTreeNode()), schemas);
			associations.SetSchemaFileAssociation(new XmlSchemaFileAssociation(".xml", "http://www.w3.org/1999/xhtml"));
			
			textEditor = new MockTextEditor();
			textEditor.Document.Text = String.Empty;
			textEditor.FileName = new FileName(@"c:\projects\test.xml");
			
			textEditor.Caret.Offset = 0;
			
			completionBinding = new XmlCodeCompletionBinding(associations);
		}
        public void Init()
        {
            schemas = new XmlSchemaCompletionCollection();
            schemas.Add(new XmlSchemaCompletion(ResourceManager.ReadXsdSchema()));

            XmlSchemaFileAssociations associations = new XmlSchemaFileAssociations(new Properties(), new DefaultXmlSchemaFileAssociations(new AddInTreeNode()), schemas);
            associations.SetSchemaFileAssociation(new XmlSchemaFileAssociation(".xsd", "http://www.w3.org/2001/XMLSchema", "xs"));

            textEditor = new MockTextEditor();
            textEditor.FileName = new FileName(@"c:\projects\test.xsd");
            textEditor.Document.Text = "<xs:schema></xs:schema>";

            // Put cursor after the first 'a' in "<xs:schema>"
            textEditor.Caret.Offset = 10;

            XmlCodeCompletionBinding completionBinding = new XmlCodeCompletionBinding(associations);
            keyPressResult = completionBinding.HandleKeyPress(textEditor, ' ');
        }
		public void Init()
		{
			XmlSchemaCompletionCollection schemas = new XmlSchemaCompletionCollection();
			xsdSchema = new XmlSchemaCompletion(ResourceManager.ReadXsdSchema());
			schemas.Add(xsdSchema);

			associations = new XmlSchemaFileAssociations(new Properties(), new DefaultXmlSchemaFileAssociations(new AddInTreeNode()), schemas);
			associations.SetSchemaFileAssociation(new XmlSchemaFileAssociation(".xsd", "http://www.w3.org/2001/XMLSchema", "xs"));
			
			textEditor = new MockTextEditor();
			textEditor.FileName = new FileName(@"c:\projects\test.xsd");
			textEditor.Document.Text = "<xs:schema elementFormDefault=\"\"></xs:schema>";
			
			// Put cursor inside the double quotes following the elementFormDefault attribute
			textEditor.Caret.Offset = 31;	
			
			completionBinding = new XmlCodeCompletionBinding(associations);
			result = completionBinding.CtrlSpace(textEditor);
		}