~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/AddIns/DisplayBindings/XmlEditor/Test/Folding/SingleEmptyElementFoldTestFixture.cs

  • Committer: sk
  • Date: 2011-09-10 05:17:57 UTC
  • Revision ID: halega@halega.com-20110910051757-qfouz1llya9m6boy
4.1.0.7915 Release Candidate 1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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)
 
3
 
 
4
using System;
 
5
using ICSharpCode.SharpDevelop.Dom;
 
6
using NUnit.Framework;
 
7
using XmlEditor.Tests.Utils;
 
8
 
 
9
namespace XmlEditor.Tests.Folding
 
10
{
 
11
        [TestFixture]
 
12
        public class SingleEmptyElementFoldTestFixture
 
13
        {
 
14
                XmlFoldParserHelper helper;
 
15
                
 
16
                [SetUp]
 
17
                public void Init()
 
18
                {
 
19
                        string xml = 
 
20
                                "<root>\r\n" +
 
21
                                "    <child />\r\n" +
 
22
                                "</root>";
 
23
                        
 
24
                        helper = new XmlFoldParserHelper();
 
25
                        helper.CreateParser();
 
26
                        helper.GetFolds(xml);
 
27
                }
 
28
                
 
29
                [Test]
 
30
                public void GetFolds_ChildElementIsEmptyElement_FoldRegionCoversRootElement()
 
31
                {
 
32
                        DomRegion region = helper.GetFirstFoldRegion();
 
33
                        
 
34
                        int beginLine = 1;
 
35
                        int endLine = 3;
 
36
                        int beginCol = 1;
 
37
                        int endCol = 8;
 
38
                        DomRegion expectedRegion = new DomRegion(beginLine, beginCol, endLine, endCol);
 
39
                        
 
40
                        Assert.AreEqual(expectedRegion, region);
 
41
                }
 
42
        }
 
43
}