public void TextElementAttributeName() { CompletionDataList attributesCompletionData = SchemaCompletionData.GetAttributeCompletionData(textElementPath); Assert.IsTrue(SchemaTestFixtureBase.Contains(attributesCompletionData, "foo"), "Unexpected text attribute name."); }
public void TextElementHasOneAttribute() { CompletionDataList attributesCompletionData = SchemaCompletionData.GetAttributeCompletionData(textElementPath); Assert.AreEqual(1, attributesCompletionData.Count, "Should have 1 text attribute."); }
public override void FixtureInit() { XmlElementPath path = new XmlElementPath(); path.Elements.Add(new QualifiedName("schema", "http://www.w3.org/2001/XMLSchema")); schemaChildElements = SchemaCompletionData.GetChildElementCompletionData(path); //schemaAttributes = SchemaCompletionData.GetAttributeCompletionData(path); // Get include elements attributes. path.Elements.Add(new QualifiedName("include", "http://www.w3.org/2001/XMLSchema")); includeAttributes = SchemaCompletionData.GetAttributeCompletionData(path); // Get annotation element info. path.Elements.RemoveLast(); path.Elements.Add(new QualifiedName("annotation", "http://www.w3.org/2001/XMLSchema")); annotationChildElements = SchemaCompletionData.GetChildElementCompletionData(path); annotationAttributes = SchemaCompletionData.GetAttributeCompletionData(path); // Get app info attributes. path.Elements.Add(new QualifiedName("appinfo", "http://www.w3.org/2001/XMLSchema")); appInfoAttributes = SchemaCompletionData.GetAttributeCompletionData(path); // Get foo attributes. path = new XmlElementPath(); path.Elements.Add(new QualifiedName("foo", "http://www.w3.org/2001/XMLSchema")); fooAttributes = SchemaCompletionData.GetAttributeCompletionData(path); }
public override void FixtureInit() { XmlElementPath path = new XmlElementPath(); path.Elements.Add(new QualifiedName("foo", "http://foo.com")); attributeValues = SchemaCompletionData.GetAttributeValueCompletionData(path, "id"); }
public void OneRootElement() { CompletionDataList elementCompletionData = SchemaCompletionData.GetElementCompletionData(); Assert.AreEqual(1, elementCompletionData.Count, "Should be 1 root element."); }
async Task Init() { if (childElements != null) { return; } IAsyncCompletionSource source = DummyCompletionSource.Instance; XmlElementPath path = new XmlElementPath(); path.Elements.Add(new QualifiedName("group", "http://www.w3.org/2001/XMLSchema")); childElements = await SchemaCompletionData.GetChildElementCompletionDataAsync(source, path, CancellationToken.None); attributes = await SchemaCompletionData.GetAttributeCompletionDataAsync(source, path, CancellationToken.None); // Get annotation child elements. path.Elements.Add(new QualifiedName("annotation", "http://www.w3.org/2001/XMLSchema")); annotationChildElements = await SchemaCompletionData.GetChildElementCompletionDataAsync(source, path, CancellationToken.None); // Get choice child elements. path.Elements.RemoveAt(path.Elements.Count - 1); path.Elements.Add(new QualifiedName("choice", "http://www.w3.org/2001/XMLSchema")); choiceChildElements = await SchemaCompletionData.GetChildElementCompletionDataAsync(source, path, CancellationToken.None); }
public override void FixtureInit() { XmlElementPath path = new XmlElementPath(); path.Elements.Add(new QualifiedName("html", "http://foo/xhtml")); attributes = SchemaCompletionData.GetAttributeCompletionData(path); }
public async Task ShipToChildElementsCount() { await Init(); Assert.AreEqual(2, (await SchemaCompletionData.GetChildElementCompletionData(shipToPath, CancellationToken.None)).Count, "Should be 2 child elements."); }
public override void FixtureInit() { XmlElementPath path = new XmlElementPath(); path.Elements.Add(new QualifiedName("note", "http://www.w3schools.com")); noteChildElements = SchemaCompletionData.GetChildElementCompletionData(path); }
public async Task ShipToChildElementsCount() { await Init(); Assert.AreEqual(2, (await SchemaCompletionData.GetChildElementCompletionDataAsync(DummyCompletionSource.Instance, shipToPath, CancellationToken.None)).Items.Length, "Should be 2 child elements."); }
public void ShipToHasAddressChildElement() { CompletionDataList data = SchemaCompletionData.GetChildElementCompletionData(shipToPath); Assert.IsTrue(SchemaTestFixtureBase.Contains(data, "address"), "Incorrect child element name."); }
public void ShipOrderHasShipToChildElement() { CompletionDataList data = SchemaCompletionData.GetChildElementCompletionData(shipOrderPath); Assert.IsTrue(SchemaTestFixtureBase.Contains(data, "shipto"), "Incorrect child element name."); }
public void OneRootElement() { ICompletionData[] elementCompletionData = SchemaCompletionData.GetElementCompletionData(); Assert.AreEqual(1, elementCompletionData.Length, "Should be 1 root element."); }
public void NoteElementHasChildElement() { CompletionDataList childElementCompletionData = SchemaCompletionData.GetChildElementCompletionData(noteElementPath); Assert.AreEqual(1, childElementCompletionData.Count, "Should be one child."); }
public void NoteElementHasNoAttributes() { ICompletionData[] attributeCompletionData = SchemaCompletionData.GetAttributeCompletionData(noteElementPath); Assert.AreEqual(0, attributeCompletionData.Length, "Should no attributes."); }
public override void FixtureInit() { XmlElementPath path = new XmlElementPath(); path.Elements.Add(new QualifiedName("foo", "http://foo.com")); fooChildElementCompletionData = SchemaCompletionData.GetChildElementCompletionData(path); }
public async Task ShipToHasAddressChildElement() { await Init(); var data = await SchemaCompletionData.GetChildElementCompletionDataAsync(DummyCompletionSource.Instance, shipToPath, CancellationToken.None); Assert.IsTrue(SchemaTestFixtureBase.Contains(data, "address"), "Incorrect child element name."); }
public void NoteElementHasNoAttributes() { CompletionDataList attributeCompletionData = SchemaCompletionData.GetAttributeCompletionData(noteElementPath); Assert.AreEqual(0, attributeCompletionData.Count, "Should no attributes."); }
public void NoteElementHasChildElement() { ICompletionData[] childElementCompletionData = SchemaCompletionData.GetChildElementCompletionData(noteElementPath); Assert.AreEqual(1, childElementCompletionData.Length, "Should be one child."); }
public void RootElementIsNote() { ICompletionData[] elementCompletionData = SchemaCompletionData.GetElementCompletionData(); Assert.IsTrue(Contains(elementCompletionData, "note"), "Should be called note."); }
public async Task RootElementIsNote() { CompletionDataList elementCompletionData = await SchemaCompletionData.GetElementCompletionData(CancellationToken.None); Assert.IsTrue(Contains(elementCompletionData, "note"), "Should be called note."); }
public async Task NoteElementHasChildElement() { CompletionDataList childElementCompletionData = await SchemaCompletionData.GetChildElementCompletionData(noteElementPath, CancellationToken.None); Assert.AreEqual(1, childElementCompletionData.Count, "Should be one child."); }
public async Task NoteElementHasNoAttributes() { CompletionDataList attributeCompletionData = await SchemaCompletionData.GetAttributeCompletionData(noteElementPath, CancellationToken.None); Assert.AreEqual(0, attributeCompletionData.Count, "Should no attributes."); }
public override void FixtureInit() { XmlElementPath path = new XmlElementPath(); path.Elements.Add(new QualifiedName("project", "http://nant.sf.net//nant-0.84.xsd")); path.Elements.Add(new QualifiedName("attrib", "http://nant.sf.net//nant-0.84.xsd")); attributes = SchemaCompletionData.GetAttributeCompletionData(path); }
public void NoAttributesForUnknownElement() { XmlElementPath path = new XmlElementPath(); path.Elements.Add(new QualifiedName("foobar", "http://www.w3schools.com")); CompletionDataList attributes = SchemaCompletionData.GetAttributeCompletionData(path); Assert.AreEqual(0, attributes.Count, "Should not find attributes for unknown element."); }
public async Task ShipOrderHasShipToChildElement() { await Init(); CompletionDataList data = await SchemaCompletionData.GetChildElementCompletionData(shipOrderPath, CancellationToken.None); Assert.IsTrue(SchemaTestFixtureBase.Contains(data, "shipto"), "Incorrect child element name."); }
public void TextHasNoChildElements() { XmlElementPath path = new XmlElementPath(); path.Elements.Add(new QualifiedName("note", "http://www.w3schools.com")); path.Elements.Add(new QualifiedName("text", "http://www.w3schools.com")); Assert.AreEqual(0, SchemaCompletionData.GetChildElementCompletionData(path).Length, "Should be no child elements."); }
public override void FixtureInit() { XmlElementPath path = new XmlElementPath(); path.Elements.Add(new QualifiedName("note", "http://www.w3schools.com")); attributeCompletionData = SchemaCompletionData.GetAttributeCompletionData(path); attributeName = attributeCompletionData[0].DisplayText; }
public override void FixtureInit() { XmlElementPath path = new XmlElementPath(); path.Elements.Add(new QualifiedName("note", "http://www.w3schools.com")); XmlSchemaElement element = SchemaCompletionData.FindElement(path); attribute = SchemaCompletionData.FindAttribute(element, "name"); missingAttribute = SchemaCompletionData.FindAttribute(element, "missing"); }
public override void FixtureInit() { XmlElementPath path = new XmlElementPath(); path.Elements.Add(new QualifiedName("person", "http://foo")); personElementChildren = SchemaCompletionData.GetChildElementCompletionData(path); path.Elements.Add(new QualifiedName("firstname", "http://foo")); firstNameAttributes = SchemaCompletionData.GetAttributeCompletionData(path); firstNameElementChildren = SchemaCompletionData.GetChildElementCompletionData(path); }