1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
5
using ICSharpCode.SharpDevelop.Dom;
7
using XmlEditor.Tests.Utils;
9
namespace XmlEditor.Tests.Folding
12
public class ShowElementAttributesInFoldTestFixture
14
XmlFoldParserHelper helper;
17
"<root a=\"1st\" b=\"2nd\" c='3rd'>\r\n" +
21
public void GetFolds_ShowAttributesIsTrue_FoldNameIsElementNameWithAttributes()
23
GetFoldsWhenShowAttributesSetToTrue();
24
string name = helper.GetFirstFoldName();
25
Assert.AreEqual("<root a=\"1st\" b=\"2nd\" c='3rd'>", name);
29
public void GetFolds_ShowAttributesIsFalse_FoldNameIsElementNameOnly()
31
GetFoldsWhenShowAttributesSetToFalse();
32
string name = helper.GetFirstFoldName();
33
Assert.AreEqual("<root>", name);
37
public void GetFolds_ShowAttributesSetToTrue_FirstFoldRegionContainsRootElement()
39
GetFoldsWhenShowAttributesSetToTrue();
41
DomRegion region = helper.GetFirstFoldRegion();
47
DomRegion expectedRegion = new DomRegion(beginLine, beginColumn, endLine, endColumn);
49
Assert.AreEqual(expectedRegion, region);
52
void GetFoldsWhenShowAttributesSetToTrue()
54
helper = new XmlFoldParserHelper();
55
helper.Options.ShowAttributesWhenFolded = true;
61
helper.CreateParser();
65
void GetFoldsWhenShowAttributesSetToFalse()
67
helper = new XmlFoldParserHelper();
68
helper.Options.ShowAttributesWhenFolded = false;