* PEAPI.cs: Clean up indentation. Split into ...
[mono.git] / mcs / class / System.Drawing / Test / System.Drawing / TestBitmap.cs
index 08457b4389fb1c76d9aa7c8469a049542acd77fa..16f0b4a0056a39f63f1242ea994530f6bb74ec33 100644 (file)
@@ -38,10 +38,12 @@ using System.IO;
 using System.Security.Cryptography;
 using System.Text;
 using System.Runtime.InteropServices;
+using System.Security.Permissions;
 
 namespace MonoTests.System.Drawing{
 
-       [TestFixture]   
+       [TestFixture]
+       [SecurityPermission (SecurityAction.Deny, UnmanagedCode = true)]
        public class TestBitmap {
                
                [TearDown]
@@ -110,7 +112,6 @@ namespace MonoTests.System.Drawing{
                        string sOutFile =  getOutSubDir() + "transparent.bmp";
                                                
                        Bitmap  bmp = new Bitmap(sInFile);
-                       Console.WriteLine("Bitmap loaded OK", bmp != null);
                                        
                        bmp.MakeTransparent();
                        bmp.Save(sOutFile);                                                     
@@ -151,11 +152,11 @@ namespace MonoTests.System.Drawing{
                        
                        Assert.AreEqual (bmp.Width, bmpNew.Width);
                        Assert.AreEqual (bmp.Height, bmpNew.Height);            
-                       Assert.AreEqual (bmp.PixelFormat, bmpNew.PixelFormat);                  
+                       Assert.AreEqual (bmp.PixelFormat, bmpNew.PixelFormat);
                        
                }       
 
-               //[Test]
+               [Test]
                public void Frames()
                {
                        string sInFile = getInFile ("bitmaps/almogaver24bits.bmp");                     
@@ -166,6 +167,13 @@ namespace MonoTests.System.Drawing{
                        Assert.AreEqual (1, cnt);                                                               
                        Assert.AreEqual (0, active);                                                                                    
                }
+               
+               [Test]
+               [ExpectedException (typeof (ArgumentException))]
+               public void FileDoesNotExists ()
+               {                       
+                       Bitmap  bmp = new Bitmap ("FileDoesNotExists.jpg");                     
+               }
 
                static string ByteArrayToString(byte[] arrInput)
                {
@@ -291,7 +299,7 @@ namespace MonoTests.System.Drawing{
                        firsts, changes them, and then using GetPixel does another check of the changes.
                        The results match the .Net framework
                */
-               [Test]
+               //[Test]
                public void LockBitmap ()
                {       
                        string hash = "";