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 attribute may have.
///
[TestFixture]
public class AttributeAnnotationTestFixture : SchemaTestFixtureBase
{
CompletionDataList fooAttributeCompletionData;
CompletionDataList barAttributeCompletionData;
public override void FixtureInit()
{
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("foo", "http://foo.com"));
fooAttributeCompletionData = SchemaCompletionData.GetAttributeCompletionData(path);
path.Elements.Add(new QualifiedName("bar", "http://foo.com"));
barAttributeCompletionData = SchemaCompletionData.GetAttributeCompletionData(path);
}
[Test]
public void FooAttributeDocumentation()
{
Assert.AreEqual("Documentation for foo attribute.", fooAttributeCompletionData[0].Description);
}
[Test]
public void BarAttributeDocumentation()
{
Assert.AreEqual("Documentation for bar attribute.", barAttributeCompletionData[0].Description);
}
protected override string GetSchema()
{
return "\r\n" +
"\t\r\n" +
"\t\t\r\n" +
"\t\t\t\t\r\n" +
"\t\t\t\t\r\n" +
"\t\t\t\r\n" +
"\t\t\t\r\n" +
"\t\t\t\r\n" +
"\t\t\t\t\t\r\n" +
"\t\t\t\t\t\tDocumentation for foo attribute.\r\n" +
"\t\t\t\t\t\r\n" +
"\t\t\t\t\r\n" +
"\t\t\r\n" +
"\t\r\n" +
"\t\r\n" +
"\t\t\r\n" +
"\t\t\t\r\n" +
"\t\t\t\tDocumentation for bar attribute.\r\n" +
"\t\t\t\t\r\n" +
"\t\t\t\r\n" +
"\t\r\n" +
"";
}
}
}