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 contains a selection tree.
19
public class SelectionTreeTestFixture : DialogLoadingTestFixtureBase
26
public void SetUpFixture()
28
CreatedComponents.Clear();
29
WixDocument doc = new WixDocument();
30
doc.LoadXml(GetWixXml());
31
WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
32
using (Form dialog = wixDialog.CreateDialog(this)) {
33
TreeView treeView = (TreeView)dialog.Controls[0];
35
location = treeView.Location;
43
Assert.AreEqual("ControlId", name);
47
public void TwoControlsCreated()
49
Assert.AreEqual(2, CreatedComponents.Count);
53
public void Location()
55
int expectedX = Convert.ToInt32(10 * WixDialog.InstallerUnit);
56
int expectedY = Convert.ToInt32(10 * WixDialog.InstallerUnit);
57
Point expectedPoint = new Point(expectedX, expectedY);
58
Assert.AreEqual(expectedPoint, location);
64
int expectedWidth = Convert.ToInt32(50 * WixDialog.InstallerUnit);
65
int expectedHeight = Convert.ToInt32(50 * WixDialog.InstallerUnit);
66
Size expectedSize = new Size(expectedWidth, expectedHeight);
68
Assert.AreEqual(expectedSize, size);
73
return "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>\r\n" +
76
"\t\t\t<Dialog Id='WelcomeDialog' Height='270' Width='370'>\r\n" +
77
"\t\t\t\t<Control Id='ControlId' Type='SelectionTree' X='10' Y='10' Width='50' Height='50' Text='Text'/>\r\n" +
78
"\t\t\t</Dialog>\r\n" +