~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/AddIns/DisplayBindings/XmlEditor/Test/Tree/LoadXmlFileWithMissingDtdFileRefTestFixture.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 ICSharpCode.XmlEditor;
 
5
using NUnit.Framework;
 
6
using System;
 
7
using System.IO;
 
8
using System.Xml;
 
9
using XmlEditor.Tests.Utils;
 
10
 
 
11
namespace XmlEditor.Tests.Tree
 
12
{
 
13
        /// <summary>
 
14
        /// If the XML loaded contains a DTD reference then if the XmlDocument.XmlResolver is not 
 
15
        /// set to null then the XmlTreeEditor will throw an unhandled FileNotFoundException.
 
16
        /// </summary>
 
17
        [TestFixture]
 
18
        public class LoadXmlFileWithMissingDtdFileRefTestFixture : XmlTreeViewTestFixtureBase
 
19
        {               
 
20
                [SetUp]
 
21
                public void Init()
 
22
                {
 
23
                        base.InitFixture();
 
24
                }
 
25
 
 
26
                [Test]
 
27
                public void RootElementIsLoaded()
 
28
                {
 
29
                        Assert.AreEqual("Library", editor.Document.DocumentElement.Name);
 
30
                }
 
31
                
 
32
                /// <summary>
 
33
                /// Returns the xhtml strict schema as the default schema.
 
34
                /// </summary>
 
35
                protected override XmlSchemaCompletion DefaultSchemaCompletion {
 
36
                        get { return new XmlSchemaCompletion(ResourceManager.ReadXhtmlStrictSchema()); }
 
37
                }
 
38
                
 
39
                protected override string GetXml()
 
40
                {
 
41
                        return "<!DOCTYPE Library  SYSTEM \"Library.dtd\">\r\n" +
 
42
                                "<Library> \r\n" +
 
43
                                "   <Book  ISBN=\"9999-44-44-3333\" > \r\n" +
 
44
                                "        <Title>SharpDevelop</Title> \r\n" +
 
45
                                "        <Author>abc</Author>\r\n" +
 
46
                                "        <Publisher>SharpDevelop Publications</Publisher>\r\n" +
 
47
                                "        <Date_Published>22/10/1999</Date_Published>\r\n" +
 
48
                                "   </Book>\r\n" +
 
49
                                "</Library>";
 
50
                }
 
51
        }
 
52
}