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

« back to all changes in this revision

Viewing changes to src/addins/MonoDevelop.XmlEditor/Tests/Schema/NestedElementSchemaTestFixture.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
        [TestFixture]
 
11
        public class NestedElementSchemaTestFixture : SchemaTestFixtureBase
 
12
        {
 
13
                XmlElementPath noteElementPath;
 
14
                ICompletionData[] elementData;
 
15
                
 
16
                public override void FixtureInit()
 
17
                {                       
 
18
                        noteElementPath = new XmlElementPath();
 
19
                        noteElementPath.Elements.Add(new QualifiedName("note", "http://www.w3schools.com"));
 
20
 
 
21
                        elementData = SchemaCompletionData.GetChildElementCompletionData(noteElementPath); 
 
22
                }
 
23
                
 
24
                [Test]
 
25
                public void NoteHasOneChildElementCompletionDataItem()
 
26
                {
 
27
                        Assert.AreEqual(1, elementData.Length, "Should be one child element completion data item.");
 
28
                }
 
29
                
 
30
                [Test]
 
31
                public void NoteChildElementCompletionDataText()
 
32
                {
 
33
                        Assert.IsTrue(SchemaTestFixtureBase.Contains(elementData, "text"),
 
34
                                      "Should be one child element called text.");
 
35
                }               
 
36
 
 
37
                protected override string GetSchema()
 
38
                {
 
39
                        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" +
 
40
                                "\t<xs:element name=\"note\">\r\n" +
 
41
                                "\t\t<xs:complexType> \r\n" +
 
42
                                "\t\t\t<xs:sequence>\r\n" +
 
43
                                "\t\t\t\t<xs:element name=\"text\" type=\"xs:string\"/>\r\n" +
 
44
                                "\t\t\t</xs:sequence>\r\n" +
 
45
                                "\t\t</xs:complexType>\r\n" +
 
46
                                "\t</xs:element>\r\n" +
 
47
                                "</xs:schema>";
 
48
                }
 
49
        }
 
50
}