public void InitializeTest() { Button button = (Button)_helper.CreateControl(typeof(TestButton), null); Assert.IsFalse((bool)_helper.GetValue(button, "Locked"), "#1"); Assert.IsTrue((bool)_helper.GetValue(button, "Visible"), "#2"); Assert.IsTrue((bool)_helper.GetValue(button, "Enabled"), "#3"); Assert.IsFalse((bool)_helper.GetValue(button, "AllowDrop"), "#4"); Assert.IsTrue(button.Enabled, "#5"); Assert.IsTrue(button.Visible, "#6"); Assert.IsFalse(button.AllowDrop, "#7"); #if NET_2_0 ControlDesigner buttonDesigner = _helper.IDesignerHost.GetDesigner(button) as ControlDesigner; Assert.AreEqual(null, buttonDesigner.InternalControlDesigner(20)); Assert.AreEqual(0, buttonDesigner.NumberOfInternalControlDesigners()); #endif }
public void InitializeTest() { Panel panel = (Panel)((IContainer)_helper.IDesignerHost).Components[0]; // the root control DocumentDesignerTest designer = _helper.IDesignerHost.GetDesigner(panel) as DocumentDesignerTest; SelectionRules rules = SelectionRules.BottomSizeable | SelectionRules.RightSizeable | SelectionRules.Visible; Assert.AreEqual(rules, designer.SelectionRules, "#1"); Assert.AreEqual(new Point(0, 0), (Point)_helper.GetValue(panel, "Location"), "#2"); #if NET_2_0 Assert.AreEqual(ViewTechnology.Default, ((IRootDesigner)designer).SupportedTechnologies[0], "#3"); Assert.IsTrue(((IRootDesigner)designer).GetView(ViewTechnology.Default) is Control, "#4"); #else Assert.AreEqual(ViewTechnology.WindowsForms, ((IRootDesigner)designer).SupportedTechnologies[0], "#3"); Assert.IsTrue(((IRootDesigner)designer).GetView(ViewTechnology.WindowsForms) is Control, "#4"); #endif }
public void TypeDescriptorFilterTest() { Control control = (Control)_helper.CreateControl(typeof(TestButton), null); try { _helper.GetValue(control, "Locked"); } catch { Assert.Fail("#1"); // "Locked" DT property has not been added } }
public void InitializeTest() { Panel panel = (Panel)_helper.CreateControl(typeof(TestPanel), null); Assert.IsFalse((bool)_helper.GetValue(panel, "AllowDrop"), "#1"); #if MS_NET && NET_1_1 Assert.IsTrue((bool)_helper.GetValue(panel, "SnapToGrid"), "#2"); Assert.IsTrue((bool)_helper.GetValue(panel, "DrawGrid"), "#3"); Assert.AreEqual(new Size(8, 8), (Size)_helper.GetValue(panel, "GridSize"), "#4"); #endif Assert.IsTrue(panel.AllowDrop, "#5"); }