~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to src/addins/MonoDevelop.XmlEditor/Tests/Schema/SimpleContentWithAttributeTestFixture.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

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