2003-02-05 Nick Drochak <ndrochak@gol.com>
authorNick Drochak <nickd@mono-cvs.ximian.com>
Tue, 4 Feb 2003 15:25:50 +0000 (15:25 -0000)
committerNick Drochak <nickd@mono-cvs.ximian.com>
Tue, 4 Feb 2003 15:25:50 +0000 (15:25 -0000)
* FileTest.cs: Have setup remove files before testing as well in case
tests were interrupted before TearDown could be called in a previous
run. Also test for specific exception in TestGetCreationTime ().

svn path=/trunk/mcs/; revision=11209

mcs/class/corlib/Test/System.IO/ChangeLog
mcs/class/corlib/Test/System.IO/FileTest.cs

index 56a2df85d1955f0dbac6318d4d7cc386cad04788..6c590f676cc5b68bdf6826521026000903e22af9 100644 (file)
@@ -1,3 +1,9 @@
+2003-02-05  Nick Drochak  <ndrochak@gol.com>
+
+       * FileTest.cs: Have setup remove files before testing as well in case
+       tests were interrupted before TearDown could be called in a previous
+       run. Also test for specific exception in TestGetCreationTime ().
+
 2003-01-28  Zoltan Varga  <vargaz@freemail.hu>
 
        * FileTest.cs: Added tests for GetCreationTime.
index 032bae95cd26781eef6182478e5d1ae2f103586b..e49c0dac4f9a3b94e7c26422f66fc0d2a3b8fc30 100644 (file)
@@ -16,6 +16,9 @@ namespace MonoTests.System.IO
        {
                protected override void SetUp ()
                {
+                       File.Delete ("resources" + Path.DirectorySeparatorChar + "baz");
+                       File.Delete ("resources" + Path.DirectorySeparatorChar + "bar");
+                       File.Delete ("resources" + Path.DirectorySeparatorChar + "foo");
                }
 
                protected override void TearDown ()
@@ -424,6 +427,7 @@ namespace MonoTests.System.IO
                        }
                }
 
+               [ExpectedException(typeof(IOException))]
                public void TestGetCreationTime ()
                {
                        string path = "resources" + Path.DirectorySeparatorChar + "baz";
@@ -432,12 +436,9 @@ namespace MonoTests.System.IO
 
                        // Test nonexistent files
                        string path2 = "resources" + Path.DirectorySeparatorChar + "filedoesnotexist";
-                       try {
-                               File.GetCreationTime (path2);
-                               Fail ();
-                       }
-                       catch (Exception ex) {
-                       }
+
+                       // should throw an exception
+                       File.GetCreationTime (path2);
                }
        }
 }