+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.
{
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 ()
}
}
+ [ExpectedException(typeof(IOException))]
public void TestGetCreationTime ()
{
string path = "resources" + Path.DirectorySeparatorChar + "baz";
// Test nonexistent files
string path2 = "resources" + Path.DirectorySeparatorChar + "filedoesnotexist";
- try {
- File.GetCreationTime (path2);
- Fail ();
- }
- catch (Exception ex) {
- }
+
+ // should throw an exception
+ File.GetCreationTime (path2);
}
}
}