public void MethodScaleControl() { Form f = new Form(); f.ShowInTaskbar = false; f.Show(); PublicGroupBox gb = new PublicGroupBox(); gb.Location = new Point(5, 10); f.Controls.Add(gb); Assert.AreEqual(new Rectangle(5, 10, 200, 100), gb.Bounds, "A1"); gb.PublicScaleControl(new SizeF(2.0f, 2.0f), BoundsSpecified.All); Assert.AreEqual(new Rectangle(10, 20, 400, 200), gb.Bounds, "A2"); gb.PublicScaleControl(new SizeF(.5f, .5f), BoundsSpecified.Location); Assert.AreEqual(new Rectangle(5, 10, 400, 200), gb.Bounds, "A3"); gb.PublicScaleControl(new SizeF(.5f, .5f), BoundsSpecified.Size); Assert.AreEqual(new Rectangle(5, 10, 200, 100), gb.Bounds, "A4"); f.Dispose(); }
public void MethodScaleControl () { Form f = new Form (); f.ShowInTaskbar = false; f.Show (); PublicGroupBox gb = new PublicGroupBox (); gb.Location = new Point (5, 10); f.Controls.Add (gb); Assert.AreEqual (new Rectangle (5, 10, 200, 100), gb.Bounds, "A1"); gb.PublicScaleControl (new SizeF (2.0f, 2.0f), BoundsSpecified.All); Assert.AreEqual (new Rectangle (10, 20, 400, 200), gb.Bounds, "A2"); gb.PublicScaleControl (new SizeF (.5f, .5f), BoundsSpecified.Location); Assert.AreEqual (new Rectangle (5, 10, 400, 200), gb.Bounds, "A3"); gb.PublicScaleControl (new SizeF (.5f, .5f), BoundsSpecified.Size); Assert.AreEqual (new Rectangle (5, 10, 200, 100), gb.Bounds, "A4"); f.Dispose (); }