2
using MonoDevelop.Ide.CodeCompletion;
3
using MonoDevelop.XmlEditor;
9
namespace MonoDevelop.XmlEditor.Tests.Schema
12
/// Tests that the completion data retrieves the annotation documentation
13
/// that an attribute may have.
16
public class AttributeAnnotationTestFixture : SchemaTestFixtureBase
18
ICompletionData[] fooAttributeCompletionData;
19
ICompletionData[] barAttributeCompletionData;
21
public override void FixtureInit()
23
XmlElementPath path = new XmlElementPath();
24
path.Elements.Add(new QualifiedName("foo", "http://foo.com"));
26
fooAttributeCompletionData = SchemaCompletionData.GetAttributeCompletionData(path);
28
path.Elements.Add(new QualifiedName("bar", "http://foo.com"));
29
barAttributeCompletionData = SchemaCompletionData.GetAttributeCompletionData(path);
33
public void FooAttributeDocumentation()
35
Assert.AreEqual("Documentation for foo attribute.", fooAttributeCompletionData[0].Description);
39
public void BarAttributeDocumentation()
41
Assert.AreEqual("Documentation for bar attribute.", barAttributeCompletionData[0].Description);
44
protected override string GetSchema()
46
return "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" targetNamespace=\"http://foo.com\" xmlns=\"http://foo.com\" elementFormDefault=\"qualified\">\r\n" +
47
"\t<xs:element name=\"foo\">\r\n" +
48
"\t\t<xs:complexType>\r\n" +
49
"\t\t\t<xs:sequence>\t\r\n" +
50
"\t\t\t\t<xs:element name=\"bar\" type=\"bar\">\r\n" +
51
"\t\t\t</xs:element>\r\n" +
52
"\t\t\t</xs:sequence>\r\n" +
53
"\t\t\t<xs:attribute name=\"id\">\r\n" +
54
"\t\t\t\t\t<xs:annotation>\r\n" +
55
"\t\t\t\t\t\t<xs:documentation>Documentation for foo attribute.</xs:documentation>\r\n" +
56
"\t\t\t\t</xs:annotation>\t\r\n" +
57
"\t\t\t</xs:attribute>\t\r\n" +
58
"\t\t</xs:complexType>\r\n" +
59
"\t</xs:element>\r\n" +
60
"\t<xs:complexType name=\"bar\">\r\n" +
61
"\t\t<xs:attribute name=\"name\">\r\n" +
62
"\t\t\t<xs:annotation>\r\n" +
63
"\t\t\t\t<xs:documentation>Documentation for bar attribute.</xs:documentation>\r\n" +
64
"\t\t\t</xs:annotation>\t\r\n" +
65
"\t\t</xs:attribute>\t\r\n" +
66
"\t</xs:complexType>\r\n" +