2
using MonoDevelop.Ide.CodeCompletion;
3
using MonoDevelop.XmlEditor;
8
namespace MonoDevelop.XmlEditor.Tests.Schema
11
/// Element that uses an attribute group ref.
14
public class AttributeGroupRefTestFixture : SchemaTestFixtureBase
16
ICompletionData[] attributeCompletionData;
18
public override void FixtureInit()
20
XmlElementPath path = new XmlElementPath();
21
path.Elements.Add(new QualifiedName("note", "http://www.w3schools.com"));
22
attributeCompletionData = SchemaCompletionData.GetAttributeCompletionData(path);
26
public void AttributeCount()
28
Assert.AreEqual(4, attributeCompletionData.Length, "Should be 4 attributes.");
32
public void NameAttribute()
34
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributeCompletionData, "name"),
35
"Attribute name does not exist.");
39
public void IdAttribute()
41
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributeCompletionData, "id"),
42
"Attribute id does not exist.");
46
public void StyleAttribute()
48
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributeCompletionData, "style"),
49
"Attribute style does not exist.");
53
public void TitleAttribute()
55
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributeCompletionData, "title"),
56
"Attribute title does not exist.");
59
protected override string GetSchema()
61
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" +
62
"<xs:attributeGroup name=\"coreattrs\">" +
63
"\t<xs:attribute name=\"id\" type=\"xs:string\"/>" +
64
"\t<xs:attribute name=\"style\" type=\"xs:string\"/>" +
65
"\t<xs:attribute name=\"title\" type=\"xs:string\"/>" +
66
"</xs:attributeGroup>" +
67
"\t<xs:element name=\"note\">\r\n" +
68
"\t\t<xs:complexType>\r\n" +
69
"\t\t\t<xs:attributeGroup ref=\"coreattrs\"/>" +
70
"\t\t\t<xs:attribute name=\"name\" type=\"xs:string\"/>\r\n" +
71
"\t\t</xs:complexType>\r\n" +
72
"\t</xs:element>\r\n" +