// // 2002-2005 AlphaSierraPapa // GNU General Public License // // $Revision$ // using ICSharpCode.TextEditor.Gui.CompletionWindow; using ICSharpCode.XmlEditor; using NUnit.Framework; using System; using System.IO; namespace XmlEditor.Tests.Schema { /// /// Retrieve completion data for an xml schema that specifies only one /// element. /// [TestFixture] public class SingleElementSchemaTestFixture : SchemaTestFixtureBase { ICompletionData[] childElementCompletionData; ICompletionData[] attributeCompletionData; public override void FixtureInit() { XmlElementPath path = new XmlElementPath(); path.Elements.Add(new QualifiedName("note", "http://www.w3schools.com")); attributeCompletionData = SchemaCompletionData.GetAttributeCompletionData(path); childElementCompletionData = SchemaCompletionData.GetChildElementCompletionData(path); } [Test] public void NamespaceUri() { Assert.AreEqual("http://www.w3schools.com", SchemaCompletionData.NamespaceUri, "Unexpected namespace."); } [Test] public void NoteElementHasNoAttributes() { Assert.AreEqual(0, attributeCompletionData.Length, "Not expecting any attributes."); } [Test] public void NoteElementHasNoChildElements() { Assert.AreEqual(0, childElementCompletionData.Length, "" + "Not expecting any child elements."); } protected override string GetSchema() { return "\r\n" + "\r\n" + "\r\n" + "\r\n" + ""; } } }