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)
4
using ICSharpCode.WixBinding;
8
using System.Windows.Forms;
11
using WixBinding.Tests.Utils;
13
namespace WixBinding.Tests.DialogLoading
16
/// Tests the loading of a simple Wix dialog that has just an id, height and
20
public class SimpleDialogTestFixture
23
FormBorderStyle borderStyle;
30
public void SetUpFixture()
32
doc = new WixDocument();
33
doc.LoadXml(GetWixXml());
34
WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
35
using (Form simpleDialog = wixDialog.CreateDialog()) {
36
dialogName = simpleDialog.Name;
37
borderStyle = simpleDialog.FormBorderStyle;
38
clientSize = simpleDialog.ClientSize;
39
minimizeBox = simpleDialog.MinimizeBox;
40
maximizeBox = simpleDialog.MaximizeBox;
47
Assert.AreEqual("WelcomeDialog", dialogName);
51
public void FixedDialogBorder()
53
Assert.AreEqual(FormBorderStyle.FixedDialog, borderStyle);
57
public void ClientSizeHeight()
59
int expectedHeight = Convert.ToInt32(270 * WixDialog.InstallerUnit);
60
Assert.AreEqual(expectedHeight, clientSize.Height);
64
public void ClientSizeWidth()
66
int expectedWidth = Convert.ToInt32(370 * WixDialog.InstallerUnit);
67
Assert.AreEqual(expectedWidth, clientSize.Width);
71
public void MinimizeBox()
73
Assert.IsTrue(minimizeBox);
77
public void MaximizeBox()
79
Assert.IsFalse(maximizeBox);
83
public void DialogIdWithSingleQuote()
85
Assert.IsNull(doc.CreateWixDialog("Test'Id", new MockTextFileReader()));
90
return "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>\r\n" +
93
"\t\t\t<Dialog Id='WelcomeDialog' Height='270' Width='370'/>\r\n" +