~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/AddIns/DisplayBindings/XmlEditor/Test/Editor/SchemaAssociationsAreEqualTests.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.XmlEditor;
 
6
using NUnit.Framework;
 
7
 
 
8
namespace XmlEditor.Tests.Editor
 
9
{
 
10
        [TestFixture]
 
11
        public class SchemaAssociationsAreEqualTests
 
12
        {
 
13
                [Test]
 
14
                public void DoNotMatchIfNamespacePrefixesAreDifferent()
 
15
                {
 
16
                        XmlSchemaFileAssociation lhs = new XmlSchemaFileAssociation("ext", "namespaceUri", "prefix");
 
17
                        XmlSchemaFileAssociation rhs = new XmlSchemaFileAssociation("ext", "namespaceUri", "different-prefix");
 
18
                        Assert.IsFalse(lhs.Equals(rhs));
 
19
                }
 
20
                
 
21
                [Test]
 
22
                public void MatchIfFileExtensionAndNamespaceUriAndPrefixMatch()
 
23
                {
 
24
                        XmlSchemaFileAssociation lhs = new XmlSchemaFileAssociation("ext", "namespaceUri", "prefix");
 
25
                        XmlSchemaFileAssociation rhs = new XmlSchemaFileAssociation("ext", "namespaceUri", "prefix");
 
26
                        Assert.IsTrue(lhs.Equals(rhs));
 
27
                }
 
28
                
 
29
                [Test]
 
30
                public void DoNotMatchIfFileExtensionsAreDifferent()
 
31
                {
 
32
                        XmlSchemaFileAssociation lhs = new XmlSchemaFileAssociation("ext", "namespaceUri", "prefix");
 
33
                        XmlSchemaFileAssociation rhs = new XmlSchemaFileAssociation("different-ext", "namespaceUri", "prefix");
 
34
                        Assert.IsFalse(lhs.Equals(rhs));
 
35
                }
 
36
                
 
37
                [Test]
 
38
                public void DoNotMatchNamespacesDifferent()
 
39
                {
 
40
                        XmlSchemaFileAssociation lhs = new XmlSchemaFileAssociation("ext", "namespaceUri", "prefix");
 
41
                        XmlSchemaFileAssociation rhs = new XmlSchemaFileAssociation("ext", "different-namespaceUri", "prefix");
 
42
                        Assert.IsFalse(lhs.Equals(rhs));
 
43
                }
 
44
                
 
45
                [Test]
 
46
                public void DoesNotMatchAStringObject()
 
47
                {
 
48
                        XmlSchemaFileAssociation lhs = new XmlSchemaFileAssociation("ext", "namespaceUri", "prefix");
 
49
                        Assert.IsFalse(lhs.Equals("String"));
 
50
                }
 
51
        }
 
52
}