~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/AddIns/BackendBindings/WixBinding/Test/DialogLoading/DialogTitleTestFixture.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.Windows.Forms;
 
8
using System.Xml;
 
9
using WixBinding;
 
10
using WixBinding.Tests.Utils;
 
11
 
 
12
namespace WixBinding.Tests.DialogLoading
 
13
{
 
14
        /// <summary>
 
15
        /// Tests the dialog title is correctly set in the form created by the 
 
16
        /// WixDesignerLoader.
 
17
        /// </summary>
 
18
        [TestFixture]
 
19
        public class DialogTitleTestFixture
 
20
        {
 
21
                string dialogTitle;
 
22
                
 
23
                [TestFixtureSetUp]
 
24
                public void SetUpFixture()
 
25
                {
 
26
                        WixDocument doc = new WixDocument();
 
27
                        doc.LoadXml(GetWixXml());
 
28
                        WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
 
29
                        using (Form dialog = wixDialog.CreateDialog()) {
 
30
                                dialogTitle = dialog.Text;
 
31
                        }
 
32
                }
 
33
                
 
34
                [Test]
 
35
                public void Title()
 
36
                {
 
37
                        Assert.AreEqual("Welcome Dialog Title", dialogTitle);
 
38
                }
 
39
                                
 
40
                string GetWixXml()
 
41
                {
 
42
                        return "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>\r\n" +
 
43
                                "\t<Fragment>\r\n" +
 
44
                                "\t\t<UI>\r\n" +
 
45
                                "\t\t\t<Dialog Id='WelcomeDialog' Title='Welcome Dialog Title' Height='100' Width='200'/>\r\n" +
 
46
                                "\t\t</UI>\r\n" +
 
47
                                "\t</Fragment>\r\n" +
 
48
                                "</Wix>";
 
49
                }
 
50
        }
 
51
}