// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using ICSharpCode.WixBinding;
using NUnit.Framework;
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Xml;
using WixBinding;
using WixBinding.Tests.Utils;
namespace WixBinding.Tests.DialogLoading
{
///
/// Tests the label font is retrieved using a Property element defined inside the
/// document.
///
[TestFixture]
public class ButtonFontTestFixture : DialogLoadingTestFixtureBase
{
string fontName;
double fontSize;
[TestFixtureSetUp]
public void SetUpFixture()
{
WixDocument doc = new WixDocument();
doc.LoadXml(GetWixXml());
WixDialog wixDialog = doc.CreateWixDialog("WelcomeDialog", new MockTextFileReader());
using (Form dialog = wixDialog.CreateDialog(this)) {
Button button = (Button)dialog.Controls[0];
fontName = button.Font.Name;
fontSize = button.Font.Size;
}
}
[Test]
public void ButtonFontName()
{
Assert.AreEqual("Arial", fontName);
}
[Test]
public void ButtonFontSize()
{
Assert.AreEqual(10.0, fontSize);
}
string GetWixXml()
{
return "\r\n" +
"\t\r\n" +
"\t\t\r\n" +
"\t\t\t{\\SmallFontStyle}\r\n" +
"\t\t\t\r\n" +
"\t\t\t\r\n" +
"\t\t\r\n" +
"\t\r\n" +
"";
}
}
}