Beispiel #1
0
        public override void FixtureInit()
        {
            XmlElementPath path = new XmlElementPath();

            path.AddElement(new QualifiedName("note", "http://www.w3schools.com"));
            noteChildElements = SchemaCompletion.GetChildElementCompletion(path);
        }
        public override void FixtureInit()
        {
            XmlElementPath path = new XmlElementPath();

            path.AddElement(new QualifiedName("schema", "http://www.w3.org/2001/XMLSchema"));

            schemaChildElements = SchemaCompletion.GetChildElementCompletion(path);
            schemaAttributes    = SchemaCompletion.GetAttributeCompletion(path);

            // Get include elements attributes.
            path.AddElement(new QualifiedName("include", "http://www.w3.org/2001/XMLSchema"));
            includeAttributes = SchemaCompletion.GetAttributeCompletion(path);

            // Get annotation element info.
            path.Elements.RemoveLast();
            path.AddElement(new QualifiedName("annotation", "http://www.w3.org/2001/XMLSchema"));

            annotationChildElements = SchemaCompletion.GetChildElementCompletion(path);
            annotationAttributes    = SchemaCompletion.GetAttributeCompletion(path);

            // Get app info attributes.
            path.AddElement(new QualifiedName("appinfo", "http://www.w3.org/2001/XMLSchema"));
            appInfoAttributes = SchemaCompletion.GetAttributeCompletion(path);

            // Get foo attributes.
            path = new XmlElementPath();
            path.AddElement(new QualifiedName("foo", "http://www.w3.org/2001/XMLSchema"));
            fooAttributes = SchemaCompletion.GetAttributeCompletion(path);
        }
        public void ShipToHasAddressChildElement()
        {
            XmlCompletionItemCollection data = SchemaCompletion.GetChildElementCompletion(shipToPath);

            Assert.IsTrue(data.Contains("address"),
                          "Incorrect child element name.");
        }
        public void ShipOrderHasShipToChildElement()
        {
            XmlCompletionItemCollection data = SchemaCompletion.GetChildElementCompletion(shipOrderPath);

            Assert.IsTrue(data.Contains("shipto"),
                          "Incorrect child element name.");
        }
        public override void FixtureInit()
        {
            XmlElementPath path = new XmlElementPath();

            path.AddElement(new QualifiedName("foo", "http://foo.com"));
            barAttributeValuesCompletionItems = SchemaCompletion.GetAttributeValueCompletion(path, "bar");
        }
        public void TextElementAttributeName()
        {
            XmlCompletionItemCollection attributesCompletionItems = SchemaCompletion.GetAttributeCompletion(textElementPath);

            Assert.IsTrue(attributesCompletionItems.Contains("foo"),
                          "Unexpected text attribute name.");
        }
Beispiel #7
0
        public override void FixtureInit()
        {
            XmlElementPath path = new XmlElementPath();

            path.AddElement(new QualifiedName("html", "http://foo/xhtml"));
            attributes = SchemaCompletion.GetAttributeCompletion(path);
        }
        public void TextElementHasOneAttribute()
        {
            XmlCompletionItemCollection attributesCompletionItems = SchemaCompletion.GetAttributeCompletion(textElementPath);

            Assert.AreEqual(1, attributesCompletionItems.Count,
                            "Should have 1 text attribute.");
        }
        public void NoteElementHasChildElement()
        {
            XmlCompletionItemCollection childElementCompletionItems
                = SchemaCompletion.GetChildElementCompletion(noteElementPath);

            Assert.AreEqual(1, childElementCompletionItems.Count,
                            "Should be one child.");
        }
Beispiel #10
0
        public override void FixtureInit()
        {
            XmlElementPath path = new XmlElementPath();

            path.AddElement(new QualifiedName("foo", "http://foo.com"));

            fooChildElementCompletion = SchemaCompletion.GetChildElementCompletion(path);
        }
        public void NoteElementHasNoAttributes()
        {
            XmlCompletionItemCollection attributeCompletionItems
                = SchemaCompletion.GetAttributeCompletion(noteElementPath);

            Assert.AreEqual(0, attributeCompletionItems.Count,
                            "Should no attributes.");
        }
Beispiel #12
0
        public void NoAttributesForUnknownElement()
        {
            XmlElementPath path = new XmlElementPath();

            path.AddElement(new QualifiedName("foobar", "http://www.w3schools.com"));
            XmlCompletionItemCollection attributes = SchemaCompletion.GetAttributeCompletion(path);

            Assert.AreEqual(0, attributes.Count, "Should not find attributes for unknown element.");
        }
Beispiel #13
0
        public override void FixtureInit()
        {
            XmlElementPath path = new XmlElementPath();

            path.AddElement(new QualifiedName("note", "http://www.w3schools.com"));

            attributeCompletionItems = SchemaCompletion.GetAttributeCompletion(path);
            attributeName            = attributeCompletionItems[0].Text;
        }
        public override void FixtureInit()
        {
            XmlElementPath path = new XmlElementPath();

            path.AddElement(new QualifiedName("project", "http://nant.sf.net//nant-0.84.xsd"));
            path.AddElement(new QualifiedName("attrib", "http://nant.sf.net//nant-0.84.xsd"));

            attributes = SchemaCompletion.GetAttributeCompletion(path);
        }
Beispiel #15
0
        public void TextHasNoChildElements()
        {
            XmlElementPath path = new XmlElementPath();

            path.AddElement(new QualifiedName("note", "http://www.w3schools.com"));
            path.AddElement(new QualifiedName("text", "http://www.w3schools.com"));
            Assert.AreEqual(0, SchemaCompletion.GetChildElementCompletion(path).Count,
                            "Should be no child elements.");
        }
Beispiel #16
0
        public void GetAttributeValueCompletion_UnionMemberTypesJoinsTwoSimpleTypesButOneDoesNotExist_DoesNotThrowException()
        {
            var path = new XmlElementPath();

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

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

            Assert.AreEqual(0, items.Count);
        }
        public void GetChildElementCompletion_ParentElementIsSubstitutionGroupButNoCorrespondingElementInSchema_NullReferenceExceptionIsNotThrown()
        {
            var path = new XmlElementPath();

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

            XmlCompletionItemCollection items = SchemaCompletion.GetChildElementCompletion(path);

            Assert.AreEqual(0, items.Count);
        }
Beispiel #18
0
        public override void FixtureInit()
        {
            XmlElementPath path = new XmlElementPath();

            path.AddElement(new QualifiedName("link", schemaNamespace));
            path.NamespacesInScope.Add(new XmlNamespace("xlink", "http://www.w3.org/1999/xlink"));

            linkElementAttributes = SchemaCompletion.GetAttributeCompletion(path);
            linkElementAttributes.Sort();
        }
        public override void FixtureInit()
        {
            XmlElementPath path = new XmlElementPath();

            path.AddElement(new QualifiedName("person", "http://foo"));
            personElementChildren = SchemaCompletion.GetChildElementCompletion(path);

            path.AddElement(new QualifiedName("firstname", "http://foo"));
            firstNameAttributes      = SchemaCompletion.GetAttributeCompletion(path);
            firstNameElementChildren = SchemaCompletion.GetChildElementCompletion(path);
        }
        public override void FixtureInit()
        {
            XmlElementPath path = new XmlElementPath();

            path.AddElement(new QualifiedName("note", "http://www.w3schools.com"));

            XmlSchemaElement element = SchemaCompletion.FindElement(path);

            attribute        = SchemaCompletion.FindAttribute(element, "name");
            missingAttribute = SchemaCompletion.FindAttribute(element, "missing");
        }
        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 override void FixtureInit()
        {
            XmlElementPath path = new XmlElementPath();

            path.AddElement(new QualifiedName("root", "http://foo"));

            rootChildElements = SchemaCompletion.GetChildElementCompletion(path);

            path.AddElement(new QualifiedName("foo", "http://foo"));

            fooAttributes = SchemaCompletion.GetAttributeCompletion(path);
        }
Beispiel #23
0
        public override void FixtureInit()
        {
            XmlElementPath path = new XmlElementPath();

            path.AddElement(new QualifiedName("project", "http://foo"));
            path.AddElement(new QualifiedName("items", "http://foo"));

            itemsElementChildren = SchemaCompletion.GetChildElementCompletion(path);

            path.AddElement(new QualifiedName("file", "http://foo"));

            fileElementAttributes = SchemaCompletion.GetAttributeCompletion(path);
            fileElementChildren   = SchemaCompletion.GetChildElementCompletion(path);
        }
        public override void FixtureInit()
        {
            XmlElementPath path = new XmlElementPath();

            path.AddElement(new QualifiedName("group", "http://www.w3.org/2001/XMLSchema"));
            childElements = SchemaCompletion.GetChildElementCompletion(path);
            attributes    = SchemaCompletion.GetAttributeCompletion(path);

            // Get annotation child elements.
            path.AddElement(new QualifiedName("annotation", "http://www.w3.org/2001/XMLSchema"));
            annotationChildElements = SchemaCompletion.GetChildElementCompletion(path);

            // Get choice child elements.
            path.Elements.RemoveLast();
            path.AddElement(new QualifiedName("choice", "http://www.w3.org/2001/XMLSchema"));
            choiceChildElements = SchemaCompletion.GetChildElementCompletion(path);
        }
        public override void FixtureInit()
        {
            // Get shipto attributes.
            shipToPath = new XmlElementPath();
            QualifiedName shipOrderName = new QualifiedName("shiporder", "http://www.w3schools.com");

            shipToPath.AddElement(shipOrderName);
            shipToPath.AddElement(new QualifiedName("shipto", "http://www.w3schools.com"));

            shipToAttributes = SchemaCompletion.GetAttributeCompletion(shipToPath);

            // Get shiporder attributes.
            shipOrderPath = new XmlElementPath();
            shipOrderPath.AddElement(shipOrderName);

            shipOrderAttributes = SchemaCompletion.GetAttributeCompletion(shipOrderPath);
        }
 public void RootElementIsNote()
 {
     Assert.IsTrue(SchemaCompletion.GetRootElementCompletion().Contains("note"),
                   "Should be called note.");
 }
 public void OneRootElement()
 {
     Assert.AreEqual(1, SchemaCompletion.GetRootElementCompletion().Count, "Should be 1 root element.");
 }
 public void ShipOrderChildElementsCount()
 {
     Assert.AreEqual(1, SchemaCompletion.GetChildElementCompletion(shipOrderPath).Count,
                     "Should be one child element.");
 }
 public void ShipToChildElementsCount()
 {
     Assert.AreEqual(2, SchemaCompletion.GetChildElementCompletion(shipToPath).Count,
                     "Should be 2 child elements.");
 }