+2004-03-19 Sanjay Gupta <gsanjay@novell.com>
+ * TestBitmap.cs: Added a test case to check exception thrown
+ if the image is saved to same file from which it is read.
+
2004-03-17 Ravindra <rkumar@novell.com>
* TestHatchBrush.cs: Added.
using System;
using System.Drawing;
using System.Drawing.Imaging;
+using System.IO;
using NUnit.Framework;
namespace MonoTests.System.Drawing{
AssertEquals (Color.FromArgb(255,255,0,0), color);
}
+ [Test]
+ [ExpectedException (typeof (IOException))]
+ public void BitmapSaveSameFile()
+ {
+ string sOutFile = getSubDir() + "linerect.bmp";
+
+ // Load
+ Bitmap bmpLoad = new Bitmap(sOutFile);
+ if( bmpLoad == null)
+ Console.WriteLine("Unable to load "+ sOutFile);
+
+ //Try saving in the same file
+ bmpLoad.Save(sOutFile, ImageFormat.Bmp);
+
+ }
+
[Test]
public void MakeTransparent()
{