public DockPanelButton() { Window w = new Window(); global::System.Windows.Controls.DockPanel p = new global::System.Windows.Controls.DockPanel(); w.Content = p; p.Children.Add(this); w.Show(); Assert.IsFalse(double.IsPositiveInfinity(measure_constraint.Width), "1"); Assert.AreEqual(result.Width, Utility.GetEmptyButtonSize(), "2"); }
public AlignmentStackPanel() { Window window = new Window(); global::System.Windows.Controls.DockPanel dock_panel = new global::System.Windows.Controls.DockPanel(); window.Content = dock_panel; window.Show(); dock_panel.Children.Add(this); HorizontalAlignment = HorizontalAlignment.Center; Size result = MeasureOverride(new Size(double.PositiveInfinity, double.PositiveInfinity)); Assert.AreEqual(result.Width, 0, "1"); Assert.AreEqual(result.Height, 0, "2"); Children.Add(new global::System.Windows.Controls.Button()); result = MeasureOverride(new Size(double.PositiveInfinity, double.PositiveInfinity)); Assert.AreEqual(result.Width, Utility.GetEmptyButtonSize(), "3"); Assert.AreEqual(result.Height, Utility.GetEmptyButtonSize(), "4"); //FIXME: Different results in Windows XP and Windows Vista. //FIXME: This fails when run with all the others and passes when run separately. I am not sure the above FIXME comment is correct. //Assert.AreEqual(ActualWidth, Utility.GetEmptyButtonSize(), "5"); //Assert.AreEqual(ActualHeight, dock_panel.ActualHeight, "6"); }
public AlignmentStackPanel () { Window window = new Window (); global::System.Windows.Controls.DockPanel dock_panel = new global::System.Windows.Controls.DockPanel (); window.Content = dock_panel; window.Show (); dock_panel.Children.Add (this); HorizontalAlignment = HorizontalAlignment.Center; Size result = MeasureOverride (new Size (double.PositiveInfinity, double.PositiveInfinity)); Assert.AreEqual (result.Width, 0, "1"); Assert.AreEqual (result.Height, 0, "2"); Children.Add (new global::System.Windows.Controls.Button ()); result = MeasureOverride (new Size (double.PositiveInfinity, double.PositiveInfinity)); Assert.AreEqual (result.Width, Utility.GetEmptyButtonSize (), "3"); Assert.AreEqual (result.Height, Utility.GetEmptyButtonSize (), "4"); //FIXME: Different results in Windows XP and Windows Vista. //FIXME: This fails when run with all the others and passes when run separately. I am not sure the above FIXME comment is correct. //Assert.AreEqual(ActualWidth, Utility.GetEmptyButtonSize(), "5"); //Assert.AreEqual(ActualHeight, dock_panel.ActualHeight, "6"); }
public DockPanelButton () { Window w = new Window (); global::System.Windows.Controls.DockPanel p = new global::System.Windows.Controls.DockPanel (); w.Content = p; p.Children.Add (this); w.Show (); Assert.IsFalse (double.IsPositiveInfinity (measure_constraint.Width), "1"); Assert.AreEqual (result.Width, Utility.GetEmptyButtonSize (), "2"); }