public void GetAttributeValueCompletion_UnionMemberTypesJoinsTwoSimpleTypes_ReturnsUnionOfSimpleTypes()
        {
            var path = new XmlElementPath();

            path.AddElement(new QualifiedName("Component", namespaceURI));

            XmlCompletionItemCollection items = SchemaCompletion.GetAttributeValueCompletion(path, "KeyPath");

            Assert.AreEqual(4, items.Count);
            Assert.IsTrue(items.Contains("yes"));
            Assert.IsTrue(items.Contains("1"));
        }
        public void TextElementAttributeName()
        {
            XmlCompletionItemCollection attributesCompletionItems = SchemaCompletion.GetAttributeCompletion(textElementPath);

            Assert.IsTrue(attributesCompletionItems.Contains("foo"),
                          "Unexpected text attribute name.");
        }
        public void ShipOrderHasShipToChildElement()
        {
            XmlCompletionItemCollection data = SchemaCompletion.GetChildElementCompletion(shipOrderPath);

            Assert.IsTrue(data.Contains("shipto"),
                          "Incorrect child element name.");
        }
        public void ShipToHasAddressChildElement()
        {
            XmlCompletionItemCollection data = SchemaCompletion.GetChildElementCompletion(shipToPath);

            Assert.IsTrue(data.Contains("address"),
                          "Incorrect child element name.");
        }
Exemplo n.º 5
0
        public void GetChildElementCompletion_StylesheetElement_SubstitutionGroupUsedForTemplateAndTemplateElementReturned()
        {
            var path = new XmlElementPath();

            path.AddElement(new QualifiedName("stylesheet", namespaceURI));

            XmlCompletionItemCollection completionItems = schemaCompletion.GetChildElementCompletion(path);
            bool contains = completionItems.Contains("template");

            Assert.IsTrue(contains);
        }
Exemplo n.º 6
0
		/// <summary>
		/// Adds an element completion data to the collection if it does not
		/// already exist.
		/// </summary>
		static void AddElement(XmlCompletionItemCollection completionItems, string name, string prefix, string documentation)
		{
			if (!completionItems.Contains(name)) {
				if (prefix.Length > 0) {
					name = String.Concat(prefix, ":", name);
				}
				XmlCompletionItem item = new XmlCompletionItem(name, documentation);
				completionItems.Add(item);
			}
		}
 public void GroupChildElementIsAnnotation()
 {
     Assert.IsTrue(childElements.Contains("annotation"),
                   "Should have a child element called annotation.");
 }
 public void FooHasClassAttribute()
 {
     Assert.IsTrue(fooAttributes.Contains("class"),
                   "Should have an attribute called class.");
 }
 public void ChoiceChildElementIsSequence()
 {
     Assert.IsTrue(choiceChildElements.Contains("element"),
                   "Should have a child element called element.");
 }
 public void ShipOrderAttributeName()
 {
     Assert.IsTrue(shipOrderAttributes.Contains("id"),
                   "Incorrect shiporder attribute name.");
 }
Exemplo n.º 11
0
 public void NoteChildElementIsText()
 {
     Assert.IsTrue(noteChildElements.Contains("text"),
                   "Should have a child element called text.");
 }
 public void NoteChildElementCompletionDataText()
 {
     Assert.IsTrue(elementCompletionItems.Contains("text"),
                   "Should be one child element called text.");
 }
Exemplo n.º 13
0
 public void ParaElementHasIdAttribute()
 {
     Assert.IsTrue(paraAttributes.Contains("id"),
                   "Should have an attribute called id.");
 }
Exemplo n.º 14
0
 public void BodyChildElementForm()
 {
     Assert.IsTrue(childElements.Contains("form"),
                   "Should have a child element called form.");
 }
Exemplo n.º 15
0
 public void HtmlLangAttribute()
 {
     Assert.IsTrue(attributes.Contains("lang"), "Attribute lang not found.");
 }
 public void FileAttribute()
 {
     Assert.IsTrue(attributes.Contains("file"),
                   "Attribute file does not exist.");
 }
Exemplo n.º 17
0
 public void NamespaceCompletionItemsCollectionContainsFirstNamespace()
 {
     Assert.IsTrue(namespaceCompletionItems.Contains(firstNamespace));
 }
Exemplo n.º 18
0
		/// <summary>
		/// Adds elements to the collection if it does not already exist.
		/// </summary>
		static void AddElements(XmlCompletionItemCollection lhs, XmlCompletionItemCollection rhs)
		{
			foreach (XmlCompletionItem item in rhs) {
				if (!lhs.Contains(item.Text)) {
					lhs.Add(item);
				}
			}
		}
 public void HtmlElementHasChildElementCalledHead()
 {
     Assert.IsTrue(htmlChildElements.Contains("head"),
                   "Should have a child element called head.");
 }
Exemplo n.º 20
0
 public void BodyAttributeName()
 {
     Assert.IsTrue(bodyAttributes.Contains("id"), "Attribute id not found.");
 }
 public void IdAttributeHasValueOne()
 {
     Assert.IsTrue(attributeValues.Contains("one"),
                   "Missing attribute value 'one'");
 }
 public void AnnotationChildElementIsAppInfo()
 {
     Assert.IsTrue(annotationChildElements.Contains("appinfo"),
                   "Should have a child element called appinfo.");
 }
 public void ShipToAttributeName()
 {
     Assert.IsTrue(shipToAttributes.Contains("address"),
                   "Incorrect shipto attribute name.");
 }
 public void AppInfoHasIdAttribute()
 {
     Assert.IsTrue(appInfoAttributes.Contains("id"),
                   "Should have an attribute called id.");
 }
 public void BarAttributeExists()
 {
     Assert.IsTrue(attributeCompletionItems.Contains("bar"),
                   "Attribute bar does not exist.");
 }
 public void GroupAttributeIsName()
 {
     Assert.IsTrue(attributes.Contains("name"),
                   "Should have an attribute called name.");
 }
 public void IncludeHasSchemaLocationAttribute()
 {
     Assert.IsTrue(includeAttributes.Contains("schemaLocation"),
                   "Should have an attribute called schemaLocation.");
 }
 public void NameAttribute()
 {
     Assert.IsTrue(attributeCompletionItems.Contains("name"),
                   "Attribute name does not exist.");
 }
 public void SchemaChildElementIsInclude()
 {
     Assert.IsTrue(schemaChildElements.Contains("include"),
                   "Should have a child element called include.");
 }
 public void CollectionContainsCompletionItemWithSpecifiedName()
 {
     Assert.IsTrue(itemCollection.Contains("text"));
 }
 public void AnnotationHasIdAttribute()
 {
     Assert.IsTrue(annotationAttributes.Contains("id"),
                   "Should have an attribute called id.");
 }
 public void RootChildElementIsFoo()
 {
     Assert.IsTrue(rootChildElements.Contains("foo"),
                   "Should have a child element called foo.");
 }