2
using MonoDevelop.Ide.CodeCompletion;
3
using MonoDevelop.XmlEditor;
8
namespace MonoDevelop.XmlEditor.Tests.Schema
11
/// Tests attribute refs
14
public class EnumAttributeValueTestFixture : SchemaTestFixtureBase
16
ICompletionData[] attributeValues;
18
public override void FixtureInit()
20
XmlElementPath path = new XmlElementPath();
21
path.Elements.Add(new QualifiedName("foo", "http://foo.com"));
22
attributeValues = SchemaCompletionData.GetAttributeValueCompletionData(path, "id");
26
public void IdAttributeHasValueOne()
28
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributeValues, "one"),
29
"Missing attribute value 'one'");
33
public void IdAttributeHasValueTwo()
35
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributeValues, "two"),
36
"Missing attribute value 'two'");
40
public void IdAttributeValueCount()
42
Assert.AreEqual(2, attributeValues.Length, "Expecting 2 attribute values.");
45
protected override string GetSchema()
47
return "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://foo.com\" targetNamespace=\"http://foo.com\" elementFormDefault=\"qualified\">\r\n" +
48
"\t<xs:element name=\"foo\">\r\n" +
49
"\t\t<xs:complexType>\r\n" +
50
"\t\t\t<xs:attribute name=\"id\">\r\n" +
51
"\t\t\t\t<xs:simpleType>\r\n" +
52
"\t\t\t\t\t<xs:restriction base=\"xs:string\">\r\n" +
53
"\t\t\t\t\t\t<xs:enumeration value=\"one\"/>\r\n" +
54
"\t\t\t\t\t\t<xs:enumeration value=\"two\"/>\r\n" +
55
"\t\t\t\t\t</xs:restriction>\r\n" +
56
"\t\t\t\t</xs:simpleType>\r\n" +
57
"\t\t\t</xs:attribute>\r\n" +
58
"\t\t</xs:complexType>\r\n" +
59
"\t</xs:element>\r\n" +