public void DefaultSize() { using (var win = new Window()) { win.Padding = 0; var test = new VariableSizeBox(200); win.Content = test; ShowWindow(win); Assert.AreEqual(200, win.Size.Width); Assert.AreEqual(100, win.Size.Height); Assert.AreEqual(200, test.ScreenBounds.Width); Assert.AreEqual(100, test.ScreenBounds.Height); } }
public void DefaultSize () { using (var win = new Window ()) { win.Padding = 0; var test = new VariableSizeBox (200); win.Content = test; ShowWindow (win); Assert.AreEqual (200, win.Size.Width); Assert.AreEqual (100, win.Size.Height); Assert.AreEqual (200, test.ScreenBounds.Width); Assert.AreEqual (100, test.ScreenBounds.Height); } }
public void FixedWidth() { using (var win = new Window()) { win.Padding = 0; var test = new VariableSizeBox(200); win.Content = test; win.Width = 300; ShowWindow(win); WaitForEvents(); Assert.AreEqual(300, win.Size.Width); Assert.AreEqual(150, win.Size.Height); Assert.AreEqual(300, test.ScreenBounds.Width); Assert.AreEqual(150, test.ScreenBounds.Height); } }
public void FixedContentGrowMakesWindowGrow() { using (var win = new Window()) { win.Padding = 0; var test = new VariableSizeBox(200); test.ForceSize = true; win.Content = test; ShowWindow(win); Assert.AreEqual(200, win.Size.Width); Assert.AreEqual(100, win.Size.Height); test.Size = 300; // The preferred size grows, and it is bigger that the constraint provided // by the window (the initial size of the window), so the window grows to adapt WaitForEvents(); Assert.AreEqual(300, win.Size.Width); Assert.AreEqual(150, win.Size.Height); Assert.AreEqual(300, test.ScreenBounds.Width); Assert.AreEqual(150, test.ScreenBounds.Height); } }
public void FlexibleContentGrowMakesWindowNotGrow() { using (var win = new Window()) { win.Padding = 0; var test = new VariableSizeBox(200); win.Content = test; ShowWindow(win); Assert.AreEqual(200, win.Size.Width); Assert.AreEqual(100, win.Size.Height); test.Size = 300; // The preferred size grows, but the widget honors the constraint given // by the window (the initial size of the window), so it doesn't make // the window grow WaitForEvents(); Assert.AreEqual(200, win.Size.Width); Assert.AreEqual(100, win.Size.Height); Assert.AreEqual(200, test.ScreenBounds.Width); Assert.AreEqual(100, test.ScreenBounds.Height); } }
public void FixedContentGrowMakesWindowGrow () { using (var win = new Window ()) { win.Padding = 0; var test = new VariableSizeBox (200); test.ForceSize = true; win.Content = test; ShowWindow (win); Assert.AreEqual (200, win.Size.Width); Assert.AreEqual (100, win.Size.Height); test.Size = 300; // The preferred size grows, and it is bigger that the constraint provided // by the window (the initial size of the window), so the window grows to adapt WaitForEvents (); Assert.AreEqual (300, win.Size.Width); Assert.AreEqual (150, win.Size.Height); Assert.AreEqual (300, test.ScreenBounds.Width); Assert.AreEqual (150, test.ScreenBounds.Height); } }
public void FlexibleContentGrowMakesWindowNotGrow () { using (var win = new Window ()) { win.Padding = 0; var test = new VariableSizeBox (200); win.Content = test; ShowWindow (win); Assert.AreEqual (200, win.Size.Width); Assert.AreEqual (100, win.Size.Height); test.Size = 300; // The preferred size grows, but the widget honors the constraint given // by the window (the initial size of the window), so it doesn't make // the window grow WaitForEvents (); Assert.AreEqual (200, win.Size.Width); Assert.AreEqual (100, win.Size.Height); Assert.AreEqual (200, test.ScreenBounds.Width); Assert.AreEqual (100, test.ScreenBounds.Height); } }
public void ContentWidthGrows () { using (var win = new Window ()) { win.Padding = 0; var test = new VariableSizeBox (200); win.Content = test; ShowWindow (win); Assert.AreEqual (200, win.Size.Width); Assert.AreEqual (100, win.Size.Height); win.Width = 300; WaitForEvents (); Assert.AreEqual (300, win.Size.Width); Assert.AreEqual (150, win.Size.Height); Assert.AreEqual (300, test.ScreenBounds.Width); Assert.AreEqual (150, test.ScreenBounds.Height); } }