using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
namespace MonoDevelop.Xml.Tests.Schema
{
///
/// Tests that the completion data retrieves the annotation documentation
/// that an element may have.
///
[TestFixture]
public class ElementAnnotationTestFixture : SchemaTestFixtureBase
{
CompletionDataList fooChildElementCompletionData;
CompletionDataList rootElementCompletionData;
public override void FixtureInit()
{
rootElementCompletionData = SchemaCompletionData.GetElementCompletionData();
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("foo", "http://foo.com"));
fooChildElementCompletionData = SchemaCompletionData.GetChildElementCompletionData(path);
}
[Test]
public void RootElementDocumentation()
{
Assert.AreEqual("Documentation for foo element.", rootElementCompletionData[0].Description);
}
[Test]
public void FooChildElementDocumentation()
{
Assert.AreEqual("Documentation for bar element.", fooChildElementCompletionData[0].Description);
}
protected override string GetSchema()
{
return "\r\n" +
"\t\r\n" +
"\t\t\r\n" +
"\t\t\tDocumentation for foo element.\r\n" +
"\t\t\r\n" +
"\t\t\r\n" +
"\t\t\t\t\r\n" +
"\t\t\t\t\r\n" +
"\t\t\t\t\t\r\n" +
"\t\t\t\t\t\tDocumentation for bar element.\r\n" +
"\t\t\t\t\t\r\n" +
"\t\t\t\r\n" +
"\t\t\t\r\n" +
"\t\t\r\n" +
"\t\r\n" +
"\t\r\n" +
"\t\t\r\n" +
"\t\t\tDocumentation for bar element.\r\n" +
"\t\t\t\r\n" +
"\t\t\r\n" +
"\t\r\n" +
"";
}
}
}