+2010-06-07 Carlos Alberto Cortez <calberto.cortez@gmail.com>
+
+ * IsolatedStorageFileTest.cs: Update our tests to catch/report the new
+ exceptions fired in 4.0, as well as a new test to assert that
+ GetDirectoryNames fires an ArgumentException if '..' is passed as part
+ of the path.
+
2010-06-06 Carlos Alberto Cortez <calberto.cortez@gmail.com>
* IsolatedStorageFileTest.cs: Include check for paths outside our
try {
isf.CreateDirectory (path);
}
+#if NET_4_0
+ catch (IsolatedStorageException ex) {
+ Assert.IsFalse (ex.Message.IndexOf (path) >= 0, "Message");
+ Assert.IsNull (ex.InnerException, "InnerException");
+ }
+#else
catch (IOException ex) {
Assert.AreEqual (typeof (IOException), ex.GetType (), "Type");
// don't leak path information
Assert.IsFalse (ex.Message.IndexOf (path) >= 0, "Message");
Assert.IsNull (ex.InnerException, "InnerException");
}
+#endif
}
}
}
[Test]
+#if NET_4_0
+ [ExpectedException (typeof (ArgumentException))]
+#else
[ExpectedException (typeof (SecurityException))]
+#endif
public void GetFilesInSubdirs ()
{
IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly ();
isf.GetFileNames (pattern);
}
+
+#if NET_4_0
+ [Test]
+ [ExpectedException (typeof (ArgumentException))]
+ public void GetDirsInSubDirs ()
+ {
+ IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly ();
+ isf.CreateDirectory ("subdir");
+ string [] dir_names = isf.GetDirectoryNames ("subdir/../*");
+ }
+#endif
+
[Test] // https://bugzilla.novell.com/show_bug.cgi?id=376188
public void CreateSubDirectory ()
{