Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/2.0@1303 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
5 changed files with 121 additions and 6 deletions
@ -0,0 +1,54 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using ICSharpCode.TextEditor.Gui.CompletionWindow; |
||||||
|
using ICSharpCode.XmlEditor; |
||||||
|
using NUnit.Framework; |
||||||
|
using System; |
||||||
|
using System.IO; |
||||||
|
|
||||||
|
namespace XmlEditor.Tests.Schema |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Tests that element completion works for any child elements
|
||||||
|
/// inside an xs:all schema element.
|
||||||
|
/// </summary>
|
||||||
|
[TestFixture] |
||||||
|
public class AllElementTestFixture : SchemaTestFixtureBase |
||||||
|
{ |
||||||
|
ICompletionData[] personElementChildren; |
||||||
|
|
||||||
|
public override void FixtureInit() |
||||||
|
{ |
||||||
|
XmlElementPath path = new XmlElementPath(); |
||||||
|
path.Elements.Add(new QualifiedName("person", "http://foo")); |
||||||
|
|
||||||
|
personElementChildren = SchemaCompletionData.GetChildElementCompletionData(path); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void PersonElementHasTwoChildElements() |
||||||
|
{ |
||||||
|
Assert.AreEqual(2, personElementChildren.Length, |
||||||
|
"Should be 2 child elements."); |
||||||
|
} |
||||||
|
|
||||||
|
protected override string GetSchema() |
||||||
|
{ |
||||||
|
return "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" elementFormDefault=\"qualified\" targetNamespace=\"http://foo\">\r\n" + |
||||||
|
" <xs:element name=\"person\">\r\n" + |
||||||
|
" <xs:complexType>\r\n" + |
||||||
|
" <xs:all>\r\n" + |
||||||
|
" <xs:element name=\"firstname\" type=\"xs:string\"/>\r\n" + |
||||||
|
" <xs:element name=\"lastname\" type=\"xs:string\"/>\r\n" + |
||||||
|
" </xs:all>\r\n" + |
||||||
|
" </xs:complexType>\r\n" + |
||||||
|
" </xs:element>\r\n" + |
||||||
|
"</xs:schema>"; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue