blob: b83fc5e7e2ba6bec3b0f0e7d6b39f8417dc43cff (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
namespace MonoDevelop.Xml.Tests.Schema
{
/// <summary>
/// Element that is a simple content type.
/// </summary>
[TestFixture]
public class SimpleContentWithAttributeSchemaTestFixture : SchemaTestFixtureBase
{
CompletionDataList attributeCompletionData;
public override void FixtureInit()
{
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("foo", "http://foo.com"));
attributeCompletionData = SchemaCompletionData.GetAttributeCompletionData(path);
}
[Test]
public void BarAttributeExists()
{
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributeCompletionData, "bar"),
"Attribute bar does not exist.");
}
protected override string GetSchema()
{
return "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"\r\n" +
"\ttargetNamespace=\"http://foo.com\"\r\n" +
"\txmlns=\"http://foo.com\">\r\n" +
"\t<xs:element name=\"foo\">\r\n" +
"\t\t<xs:complexType>\r\n" +
"\t\t\t<xs:simpleContent>\r\n" +
"\t\t\t\t<xs:extension base=\"xs:string\">\r\n" +
"\t\t\t\t\t<xs:attribute name=\"bar\">\r\n" +
"\t\t\t\t\t\t<xs:simpleType>\r\n" +
"\t\t\t\t\t\t\t<xs:restriction base=\"xs:NMTOKEN\">\r\n" +
"\t\t\t\t\t\t\t\t<xs:enumeration value=\"default\"/>\r\n" +
"\t\t\t\t\t\t\t\t<xs:enumeration value=\"enable\"/>\r\n" +
"\t\t\t\t\t\t\t\t<xs:enumeration value=\"disable\"/>\r\n" +
"\t\t\t\t\t\t\t\t<xs:enumeration value=\"hide\"/>\r\n" +
"\t\t\t\t\t\t\t\t<xs:enumeration value=\"show\"/>\r\n" +
"\t\t\t\t\t\t\t</xs:restriction>\r\n" +
"\t\t\t\t\t\t</xs:simpleType>\r\n" +
"\t\t\t\t\t</xs:attribute>\r\n" +
"\t\t\t\t\t<xs:attribute name=\"id\" type=\"xs:string\"/>\r\n" +
"\t\t\t\t\t<xs:attribute name=\"msg\" type=\"xs:string\"/>\r\n" +
"\t\t\t\t</xs:extension>\r\n" +
"\t\t\t</xs:simpleContent>\r\n" +
"\t\t</xs:complexType>\r\n" +
"\t</xs:element>\r\n" +
"</xs:schema>";
}
}
}
|