public override void Test_Construction_WithControlFactory_ShouldSetControlFactory() { //---------------Set up test pack------------------- IControlFactory factory = CreateNewControlFactory(); //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- IMainTitleIconControl outlookStyleMenu = new MainTitleIconControlWin(factory); //---------------Test Result ----------------------- Assert.AreSame(factory, outlookStyleMenu.ControlFactory); }
public void TestRemoveIcon() { //---------------Set up test pack------------------- MainTitleIconControlWin titleIconControl = new MainTitleIconControlWin(GetControlFactory()); //---------------Assert Precondition---------------- Assert.AreEqual(1, titleIconControl.Controls.Count); Assert.AreEqual(2, titleIconControl.Panel.Controls.Count); //---------------Execute Test ---------------------- titleIconControl.RemoveIconImage(); //---------------Test Result ----------------------- Assert.IsNotNull(((LabelWin)titleIconControl.Icon).BackgroundImage); }
public void TestSetInvalidIcon() { //---------------Set up test pack------------------- MainTitleIconControlWin titleIconControl = new MainTitleIconControlWin(GetControlFactory()); //---------------Assert Precondition---------------- Assert.AreEqual(1, titleIconControl.Controls.Count); Assert.AreEqual(2, titleIconControl.Panel.Controls.Count); //---------------Execute Test ---------------------- titleIconControl.SetInvalidImage(); //---------------Test Result ----------------------- //TODO Brett 20 Apr 2009: Nubb to fix Assert.AreEqual("Images.Invalid.gif", ((LabelWin)titleIconControl.Icon).BackgroundImage.ToString()); }
public void Test_CreateMainTitleIconControl() { //---------------Set up test pack------------------- //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- MainTitleIconControlWin titleIconControl = new MainTitleIconControlWin(GetControlFactory()); //---------------Test Result ----------------------- Assert.AreEqual(23, titleIconControl.Height); Assert.AreEqual(1, titleIconControl.Controls.Count); Assert.AreEqual(DockStyle.Top, DockStyleWin.GetDockStyle(titleIconControl.Dock)); Assert.IsInstanceOf(typeof(IPanel), titleIconControl.Panel); const string headerImage = "Images.headergradient.png"; AssertBackGroundImageIsSet(titleIconControl, headerImage); AssertBackGroundimageIsTile(titleIconControl); Assert.AreEqual(Color.Transparent, titleIconControl.Panel.BackColor); Assert.AreEqual(DockStyle.Top, titleIconControl.Panel.Dock); Assert.AreEqual(23, titleIconControl.Panel.Height); Assert.AreEqual(2, titleIconControl.Panel.Controls.Count); Assert.IsInstanceOf(typeof(ILabel), titleIconControl.Icon); Assert.IsNotNull(GetBackGroundImage(titleIconControl)); Assert.AreEqual(Color.Transparent, titleIconControl.Icon.BackColor); AssertBackGroundImagelayoutCentre(titleIconControl); Assert.AreEqual(DockStyle.Left, titleIconControl.Icon.Dock); Assert.IsInstanceOf(typeof(ILabel), titleIconControl.Title); Assert.IsEmpty("", titleIconControl.Title.Text); Assert.AreEqual(DockStyle.Fill, titleIconControl.Title.Dock); Assert.AreEqual(Color.Transparent, titleIconControl.Title.BackColor); Assert.AreEqual(ContentAlignment.MiddleLeft, titleIconControl.Title.TextAlign); }