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 line.
19
public class LineTestFixture : DialogLoadingTestFixtureBase
23
BorderStyle lineBorder;
27
public void SetUpFixture()
29
CreatedComponents.Clear();
30
WixDocument doc = new WixDocument();
31
doc.LoadXml(GetWixXml());
32
WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
33
using (Form dialog = wixDialog.CreateDialog(this)) {
34
Label line = (Label)dialog.Controls[0];
36
lineLocation = line.Location;
37
lineBorder = line.BorderStyle;
43
public void LineName()
45
Assert.AreEqual("BottomLine", lineName);
49
public void TwoControlsCreated()
51
Assert.AreEqual(2, CreatedComponents.Count);
55
public void LineLocation()
57
int expectedX = Convert.ToInt32(10 * WixDialog.InstallerUnit);
58
int expectedY = Convert.ToInt32(234 * WixDialog.InstallerUnit);
59
Point expectedPoint = new Point(expectedX, expectedY);
60
Assert.AreEqual(expectedPoint, lineLocation);
64
public void LineSize()
66
int expectedWidth = Convert.ToInt32(360 * WixDialog.InstallerUnit);
67
int expectedHeight = Convert.ToInt32(2 * WixDialog.InstallerUnit);
68
Size expectedSize = new Size(expectedWidth, expectedHeight);
70
Assert.AreEqual(expectedSize, lineSize);
74
/// Should be fixed 3d since this gives the best looking line.
77
public void LineBorder()
79
Assert.AreEqual(BorderStyle.Fixed3D, lineBorder);
84
return "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>\r\n" +
87
"\t\t\t<Dialog Id='WelcomeDialog' Height='270' Width='370'>\r\n" +
88
"\t\t\t\t<Control Id='BottomLine' Type='Line' X='10' Y='234' Width='360' Height='0' />\r\n" +
89
"\t\t\t</Dialog>\r\n" +