#develop (short for SharpDevelop) is a free IDE for .NET programming languages.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

66 lines
1.7 KiB

// <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 System;
using System.Collections.Generic;
using System.Xml;
using System.Xml.Schema;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.XmlEditor;
using NUnit.Framework;
using XmlEditor.Tests.Utils;
namespace XmlEditor.Tests.Folding
{
[TestFixture]
public class QualifiedElementWithNoDefinedNamespaceFoldTestFixture
{
XmlFoldParser parser;
ICompilationUnit unit;
DefaultXmlFileExtensions extensions;
DefaultProjectContent projectContent;
MockTextBuffer textBuffer;
XmlEditorOptions options;
[SetUp]
public void Init()
{
string xml =
"<t:root>\r\n" +
"</t:root>";
projectContent = new DefaultProjectContent();
textBuffer = new MockTextBuffer(xml);
extensions = new DefaultXmlFileExtensions(null);
options = new XmlEditorOptions(new Properties());
parser = new XmlFoldParser(extensions, options);
unit = parser.Parse(projectContent, @"a.xml", textBuffer);
}
[Test]
public void FoldNameContainsFullyQualifiedElementName()
{
Assert.AreEqual("<t:root>", unit.FoldingRegions[0].Name);
}
[Test]
public void FoldRegionContainsRootElement()
{
int beginLine = 1;
int beginColumn = 1;
int endLine = 2;
int endColumn = 10;
DomRegion expectedRegion = new DomRegion(beginLine, beginColumn, endLine, endColumn);
Assert.AreEqual(expectedRegion, unit.FoldingRegions[0].Region);
}
}
}