+ string tempDir = Path.Combine (Path.GetTempPath (), typeof (SaveTest).FullName);
+
+ [SetUp]
+ protected void SetUp ()
+ {
+ var rand = new Random ();
+ string basePath = tempDir;
+ while (Directory.Exists (tempDir))
+ tempDir = Path.Combine (basePath, rand.Next ().ToString ());
+ Directory.CreateDirectory (tempDir);
+ }
+
+ [TearDown]
+ protected void TearDown ()
+ {
+ try {
+ Directory.Delete (tempDir, true);
+ } catch (DirectoryNotFoundException) {
+ } catch (IOException) {
+ // Can happen on Windows if assemblies from this dir are still used
+ }
+ }
+