+2008-12-02 Jonathan Pobst <monkey@jpobst.com>
+
+ * PaintEventArgsTest.cs: Tests were failing due to being dependent
+ on the order in which the tests were running, which changed when we
+ did nunit 2.2->2.4. Modified tests to not use global Graphics contexts,
+ and to dispose the Graphics like they were relying on the
+ GraphicsDispose () test to do.
+
2008-11-24 Jonathan Pobst <monkey@jpobst.com>
* DataGridViewDataBindingTest.cs: Flush and add test for bug #448005.
#endif
public void IDisposable_IDispose ()
{
+ Bitmap bmp = new Bitmap (1, 1);
+ Graphics default_graphics = Graphics.FromImage (bmp);
+ Rectangle default_rect = new Rectangle (Int32.MinValue, Int32.MinValue, Int32.MaxValue, Int32.MaxValue);
+
PaintEventArgs pea = new PaintEventArgs (default_graphics, default_rect);
(pea as IDisposable).Dispose ();
// uho, under 2.0 we not really disposing the stuff - it means it's not ours to dispose!
[ExpectedException (typeof (ArgumentException))]
public void Dispose_True ()
{
+ Bitmap bmp = new Bitmap (1, 1);
+ Graphics default_graphics = Graphics.FromImage (bmp);
+ Rectangle default_rect = new Rectangle (Int32.MinValue, Int32.MinValue, Int32.MaxValue, Int32.MaxValue);
+
PaintEventArgsTester pea = new PaintEventArgsTester (default_graphics, default_rect);
+ pea.Graphics.Dispose ();
pea.DisposeBool (true);
Assert.IsTrue (pea.Graphics.Transform.IsIdentity, "Graphics.Transform");
}
[ExpectedException (typeof (ArgumentException))]
public void Dispose_False ()
{
+ Bitmap bmp = new Bitmap (1, 1);
+ Graphics default_graphics = Graphics.FromImage (bmp);
+ Rectangle default_rect = new Rectangle (Int32.MinValue, Int32.MinValue, Int32.MaxValue, Int32.MaxValue);
+
PaintEventArgsTester pea = new PaintEventArgsTester (default_graphics, default_rect);
+ pea.Graphics.Dispose ();
pea.DisposeBool (false);
Assert.IsTrue (pea.Graphics.Transform.IsIdentity, "Graphics.Transform");
}