2
using MonoDevelop.Ide.CodeCompletion;
3
using MonoDevelop.XmlEditor;
8
namespace MonoDevelop.XmlEditor.Tests.Schema
11
public class NestedElementSchemaTestFixture : SchemaTestFixtureBase
13
XmlElementPath noteElementPath;
14
ICompletionData[] elementData;
16
public override void FixtureInit()
18
noteElementPath = new XmlElementPath();
19
noteElementPath.Elements.Add(new QualifiedName("note", "http://www.w3schools.com"));
21
elementData = SchemaCompletionData.GetChildElementCompletionData(noteElementPath);
25
public void NoteHasOneChildElementCompletionDataItem()
27
Assert.AreEqual(1, elementData.Length, "Should be one child element completion data item.");
31
public void NoteChildElementCompletionDataText()
33
Assert.IsTrue(SchemaTestFixtureBase.Contains(elementData, "text"),
34
"Should be one child element called text.");
37
protected override string GetSchema()
39
return "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" targetNamespace=\"http://www.w3schools.com\" xmlns=\"http://www.w3schools.com\" elementFormDefault=\"qualified\">\r\n" +
40
"\t<xs:element name=\"note\">\r\n" +
41
"\t\t<xs:complexType> \r\n" +
42
"\t\t\t<xs:sequence>\r\n" +
43
"\t\t\t\t<xs:element name=\"text\" type=\"xs:string\"/>\r\n" +
44
"\t\t\t</xs:sequence>\r\n" +
45
"\t\t</xs:complexType>\r\n" +
46
"\t</xs:element>\r\n" +