Merge pull request #1972 from esdrubal/proc_pidpath
[mono.git] / mcs / class / corlib / Test / System.IO.IsolatedStorage / IsolatedStorageFileTest.cs
index c3d4e01665ac4b9900e6e8080589393a984a1b70..66eb27ed32407833e14b69f9fc6cb357b4f3d7ab 100644 (file)
@@ -56,10 +56,8 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
                                Assert.IsNotNull (isf.AssemblyIdentity, prefix + "AssemblyIdentity");
                        if ((isf.Scope & IsolatedStorageScope.Domain) != 0)
                                Assert.IsNotNull (isf.DomainIdentity, prefix + "DomainIdentity");
-#if NET_2_0
                        if ((isf.Scope & IsolatedStorageScope.Application) != 0)
                                Assert.IsNotNull (isf.ApplicationIdentity, prefix + "ApplicationIdentity");
-#endif
                }
 
                private void GetEnumerator (IsolatedStorageScope scope)
@@ -100,7 +98,6 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
                        // giving more details is bad
                        GetEnumerator (IsolatedStorageScope.User | IsolatedStorageScope.Assembly | IsolatedStorageScope.Domain | IsolatedStorageScope.Roaming);
                }
-#if NET_2_0
                [Test]
                public void GetEnumerator_Machine ()
                {
@@ -121,7 +118,6 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
                        // we can't enum application
                        GetEnumerator (IsolatedStorageScope.Application);
                }
-#endif
                [Test]
                public void GetUserStoreForAssembly ()
                {
@@ -147,7 +143,6 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
                        object o = isf.DomainIdentity;
                }
 
-#if NET_2_0
                [Test]
                [ExpectedException (typeof (InvalidOperationException))]
                public void GetUserStoreForAssembly_ApplicationIdentity ()
@@ -155,7 +150,6 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
                        IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly ();
                        object o = isf.ApplicationIdentity;
                }
-#endif
 
                [Test]
                public void GetUserStoreForDomain ()
@@ -178,7 +172,6 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
                        Assert.IsTrue ((isf.CurrentSize >= 0), "CurrentSize");
                }
 
-#if NET_2_0
                [Test]
                [ExpectedException (typeof (InvalidOperationException))]
                public void GetUserStoreForDomain_ApplicationIdentity ()
@@ -230,9 +223,7 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
                        object o = isf.DomainIdentity;
                }
 #endif
-#endif
 
-#if NET_4_0
                // This is supposed to be working only in SL.
                [Test]
                [ExpectedException (typeof (NotSupportedException))]
@@ -240,7 +231,6 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
                {
                        IsolatedStorageFile.GetUserStoreForSite ();
                }
-#endif
 
                [Test]
                public void GetStore_Domain_Zone ()
@@ -465,19 +455,10 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
                                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
                        }
                }
 
@@ -506,11 +487,7 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
                }
 
                [Test]
-#if NET_4_0
                [ExpectedException (typeof (ArgumentException))]
-#else
-               [ExpectedException (typeof (SecurityException))]
-#endif
                public void GetFilesInSubdirs ()
                {
                        IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly ();
@@ -519,7 +496,6 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
                }
 
         
-#if NET_4_0
                [Test]
                [ExpectedException (typeof (ArgumentException))]
                public void GetDirsInSubDirs ()
@@ -528,7 +504,6 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
                        isf.CreateDirectory ("subdir");
                        string [] dir_names = isf.GetDirectoryNames ("subdir/../*");
                }
-#endif
 
                [Test] // https://bugzilla.novell.com/show_bug.cgi?id=376188
                public void CreateSubDirectory ()
@@ -563,7 +538,6 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
                        } catch (ArgumentNullException) {
                        }
 
-#if NET_4_0
                        // We are getting an internal IndexOutOfRangeException in 2.0
                        // Not sure we want to mimic that one.
                        try {
@@ -571,7 +545,6 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
                                Assert.Fail ("#Exc1");
                        } catch (IsolatedStorageException) {
                        }
-#endif
 
                        try {
                                isf.DeleteFile ("idontexist");
@@ -579,13 +552,11 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
                        } catch (IsolatedStorageException) {
                        }
 
-#if NET_4_0
                        try {
                                isf.DeleteFile ("../../file");
                                Assert.Fail ("#Exc3");
                        } catch (IsolatedStorageException) {
                        }
-#endif
                
                        try {
                                isf.DeleteFile ("subdir/file");
@@ -626,7 +597,6 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
                        }
                }
 
-#if NET_4_0
                [Test]
                public void Remove ()
                {
@@ -1064,7 +1034,6 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
                                isf.MoveFile ("  ", "file-new-new");
                                Assert.Fail ("#Exc2");
                        } catch (ArgumentException e) {
-                               Console.WriteLine (e);
                        }
 
                        try {
@@ -1129,7 +1098,6 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
                                isf.DeleteDirectory ("dir1");
                        }
                }
-#endif
                [Test]
                public void RootedDirectory ()
                {