2
using MonoDevelop.Ide.CodeCompletion;
3
using MonoDevelop.XmlEditor;
8
namespace MonoDevelop.XmlEditor.Tests.Schema
11
/// Element that is a simple content type.
14
public class SimpleContentWithAttributeSchemaTestFixture : SchemaTestFixtureBase
16
ICompletionData[] attributeCompletionData;
18
public override void FixtureInit()
20
XmlElementPath path = new XmlElementPath();
21
path.Elements.Add(new QualifiedName("foo", "http://foo.com"));
23
attributeCompletionData = SchemaCompletionData.GetAttributeCompletionData(path);
27
public void BarAttributeExists()
29
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributeCompletionData, "bar"),
30
"Attribute bar does not exist.");
33
protected override string GetSchema()
35
return "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"\r\n" +
36
"\ttargetNamespace=\"http://foo.com\"\r\n" +
37
"\txmlns=\"http://foo.com\">\r\n" +
38
"\t<xs:element name=\"foo\">\r\n" +
39
"\t\t<xs:complexType>\r\n" +
40
"\t\t\t<xs:simpleContent>\r\n" +
41
"\t\t\t\t<xs:extension base=\"xs:string\">\r\n" +
42
"\t\t\t\t\t<xs:attribute name=\"bar\">\r\n" +
43
"\t\t\t\t\t\t<xs:simpleType>\r\n" +
44
"\t\t\t\t\t\t\t<xs:restriction base=\"xs:NMTOKEN\">\r\n" +
45
"\t\t\t\t\t\t\t\t<xs:enumeration value=\"default\"/>\r\n" +
46
"\t\t\t\t\t\t\t\t<xs:enumeration value=\"enable\"/>\r\n" +
47
"\t\t\t\t\t\t\t\t<xs:enumeration value=\"disable\"/>\r\n" +
48
"\t\t\t\t\t\t\t\t<xs:enumeration value=\"hide\"/>\r\n" +
49
"\t\t\t\t\t\t\t\t<xs:enumeration value=\"show\"/>\r\n" +
50
"\t\t\t\t\t\t\t</xs:restriction>\r\n" +
51
"\t\t\t\t\t\t</xs:simpleType>\r\n" +
52
"\t\t\t\t\t</xs:attribute>\r\n" +
53
"\t\t\t\t\t<xs:attribute name=\"id\" type=\"xs:string\"/>\r\n" +
54
"\t\t\t\t\t<xs:attribute name=\"msg\" type=\"xs:string\"/>\r\n" +
55
"\t\t\t\t</xs:extension>\r\n" +
56
"\t\t\t</xs:simpleContent>\r\n" +
57
"\t\t</xs:complexType>\r\n" +
58
"\t</xs:element>\r\n" +