1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
5
using ICSharpCode.SharpDevelop.Editor.CodeCompletion;
6
using ICSharpCode.XmlEditor;
9
namespace XmlEditor.Tests.Schema
12
/// Tests attribute refs
15
public class EnumAttributeValueTestFixture : SchemaTestFixtureBase
17
XmlCompletionItemCollection attributeValues;
19
public override void FixtureInit()
21
XmlElementPath path = new XmlElementPath();
22
path.AddElement(new QualifiedName("foo", "http://foo.com"));
23
attributeValues = SchemaCompletion.GetAttributeValueCompletion(path, "id");
27
public void IdAttributeHasValueOne()
29
Assert.IsTrue(attributeValues.Contains("one"),
30
"Missing attribute value 'one'");
34
public void IdAttributeHasValueTwo()
36
Assert.IsTrue(attributeValues.Contains("two"),
37
"Missing attribute value 'two'");
41
public void IdAttributeValueCount()
43
Assert.AreEqual(2, attributeValues.Count, "Expecting 2 attribute values.");
46
protected override string GetSchema()
48
return "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://foo.com\" targetNamespace=\"http://foo.com\" elementFormDefault=\"qualified\">\r\n" +
49
"\t<xs:element name=\"foo\">\r\n" +
50
"\t\t<xs:complexType>\r\n" +
51
"\t\t\t<xs:attribute name=\"id\">\r\n" +
52
"\t\t\t\t<xs:simpleType>\r\n" +
53
"\t\t\t\t\t<xs:restriction base=\"xs:string\">\r\n" +
54
"\t\t\t\t\t\t<xs:enumeration value=\"one\"/>\r\n" +
55
"\t\t\t\t\t\t<xs:enumeration value=\"two\"/>\r\n" +
56
"\t\t\t\t\t</xs:restriction>\r\n" +
57
"\t\t\t\t</xs:simpleType>\r\n" +
58
"\t\t\t</xs:attribute>\r\n" +
59
"\t\t</xs:complexType>\r\n" +
60
"\t</xs:element>\r\n" +