~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to src/addins/MonoDevelop.XmlEditor/Tests/Paths/SingleElementPathTestFixture.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
using MonoDevelop.XmlEditor;
 
3
using NUnit.Framework;
 
4
using System;
 
5
 
 
6
namespace MonoDevelop.XmlEditor.Tests.Paths
 
7
{
 
8
        [TestFixture]
 
9
        public class SingleElementPathTestFixture
 
10
        {
 
11
                XmlElementPath path;
 
12
                QualifiedName qualifiedName;
 
13
                
 
14
                [SetUp]
 
15
                public void Init()
 
16
                {
 
17
                        path = new XmlElementPath();
 
18
                        qualifiedName = new QualifiedName("foo", "http://foo");
 
19
                        path.Elements.Add(qualifiedName);
 
20
                }
 
21
                
 
22
                [Test]
 
23
                public void HasOneItem()
 
24
                {
 
25
                        Assert.AreEqual(1, path.Elements.Count, 
 
26
                                        "Should have 1 element.");
 
27
                }
 
28
                
 
29
                [Test]
 
30
                public void RemoveLastItem()
 
31
                {
 
32
                        path.Elements.RemoveLast();
 
33
                        Assert.AreEqual(0, path.Elements.Count, "Should have no items.");
 
34
                }
 
35
                
 
36
                [Test]
 
37
                public void Equality()
 
38
                {
 
39
                        XmlElementPath newPath = new XmlElementPath();
 
40
                        newPath.Elements.Add(new QualifiedName("foo", "http://foo"));
 
41
                        
 
42
                        Assert.IsTrue(newPath.Equals(path), "Should be equal.");
 
43
                }
 
44
                
 
45
                [Test]
 
46
                public void NotEqual()
 
47
                {
 
48
                        XmlElementPath newPath = new XmlElementPath();
 
49
                        newPath.Elements.Add(new QualifiedName("Foo", "bar"));
 
50
                        
 
51
                        Assert.IsFalse(newPath.Equals(path), "Should not be equal.");
 
52
                }       
 
53
                
 
54
                [Test]
 
55
                public void Compact()
 
56
                {
 
57
                        path.Compact();
 
58
                        Equality();
 
59
                }
 
60
        }
 
61
}