New test.
[mono.git] / mcs / class / corlib / Test / System.IO / FileInfoTest.cs
index fc9db6d9ae916e6e1d11405a2c0344493bca6334..2bba0bf2bc1e2926a067ef3e31db07efcffb5ebb 100644 (file)
@@ -105,6 +105,35 @@ namespace MonoTests.System.IO
                                DeleteFile (path);
                        }
                }
+
+#if NET_2_0
+               
+               [Test, Category ("NotWorking")]
+               public void IsReadOnly ()
+               {
+                       string path = TempFolder + DSC + "FIT.IsReadOnly.Test";
+                       DeleteFile (path);
+                       
+                       try {
+                               FileStream stream = File.Create (path);
+                               stream.WriteByte (12);
+                               stream.Close ();
+
+                               FileInfo info1 = new FileInfo (path);
+                               AssertEquals ("test#01", false, info1.IsReadOnly);
+
+                               FileInfo info2 = new FileInfo (path);
+                               info2.IsReadOnly = true;
+                               AssertEquals ("test#02", true, info1.IsReadOnly);
+
+                               FileInfo info3 = new FileInfo (path);
+                               info2.IsReadOnly = false;
+                               AssertEquals ("test#03", false, info1.IsReadOnly);
+                       } finally {
+                               DeleteFile (path);
+                       }
+               }
+#endif
                
                [Test]
                public void Length ()