~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/AddIns/BackendBindings/WixBinding/Test/Document/NonRootDirectoryTestFixture.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.WixBinding;
 
5
using NUnit.Framework;
 
6
using System;
 
7
using System.IO;
 
8
using System.Xml;
 
9
 
 
10
namespace WixBinding.Tests.Document
 
11
{
 
12
        /// <summary>
 
13
        /// Tests that the only a directory with an Id of TARGETDIR is detected as
 
14
        /// the root directory in a wix file.
 
15
        /// </summary>
 
16
        [TestFixture]
 
17
        public class NonRootDirectoryTestFixture
 
18
        {               
 
19
                XmlElement directory;
 
20
                
 
21
                [SetUp]
 
22
                public void SetUpFixture()
 
23
                {
 
24
                        WixDocument doc = new WixDocument();
 
25
                        doc.LoadXml(GetWixXml());
 
26
                        directory = doc.GetRootDirectory();
 
27
                }
 
28
                
 
29
                [Test]
 
30
                public void NoRootDirectoryFound()
 
31
                {
 
32
                        Assert.IsNull(directory);
 
33
                }
 
34
                
 
35
                string GetWixXml()
 
36
                {
 
37
                        return "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>\r\n" +
 
38
                                "\t<Product Name='DialogTest' \r\n" +
 
39
                                "\t         Version='1.0' \r\n" +
 
40
                                "\t         Language='1013' \r\n" +
 
41
                                "\t         Manufacturer='#develop' \r\n" +
 
42
                                "\t         Id='????????-????-????-????-????????????'>\r\n" +
 
43
                                "\t\t<Package/>\r\n" +
 
44
                                "\t\t<Directory Id=\"TESTDIR\" SourceName=\"SourceDir\">\r\n" +
 
45
                                "\t\t</Directory>\r\n" +
 
46
                                "\t</Product>\r\n" +
 
47
                                "</Wix>";
 
48
                }
 
49
        }
 
50
}