// // // // // $Revision$ // using System; using System.Collections.Generic; 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 AttributeTextInFoldIsXmlEncodedTestFixture { XmlFoldParser parser; ICompilationUnit unit; DefaultXmlFileExtensions extensions; DefaultProjectContent projectContent; MockTextBuffer textBuffer; XmlEditorOptions options; [SetUp] public void Init() { projectContent = new DefaultProjectContent(); extensions = new DefaultXmlFileExtensions(null); options = new XmlEditorOptions(new Properties()); parser = new XmlFoldParser(extensions, options); } void ParseWithShowAttributesSetToTrue(string xml) { options.ShowAttributesWhenFolded = true; textBuffer = new MockTextBuffer(xml); unit = parser.Parse(projectContent, @"d:\projects\a.xml", textBuffer); } [Test] public void FoldAttributeTextHasSingleQuoteEncoded() { string xml = "\r\n" + ""; ParseWithShowAttributesSetToTrue(xml); Assert.AreEqual("", unit.FoldingRegions[0].Name); } [Test] public void FoldAttributeTextHasDoubleQuoteEncoded() { string xml = "\r\n" + ""; ParseWithShowAttributesSetToTrue(xml); Assert.AreEqual("", unit.FoldingRegions[0].Name); } [Test] public void FoldAttributeTextHasAmpersandEncoded() { string xml = "\r\n" + ""; ParseWithShowAttributesSetToTrue(xml); Assert.AreEqual("", unit.FoldingRegions[0].Name); } [Test] public void FoldAttributeTextHasLessThanTagEncoded() { string xml = "\r\n" + ""; ParseWithShowAttributesSetToTrue(xml); Assert.AreEqual("", unit.FoldingRegions[0].Name); } [Test] public void FoldAttributeTextHasGreaterThanTagEncoded() { string xml = "\r\n" + ""; ParseWithShowAttributesSetToTrue(xml); Assert.AreEqual("", unit.FoldingRegions[0].Name); } } }