2006-10-30 Joel Reed <joel.reed@ddiworld.com>
authorMiguel de Icaza <miguel@gnome.org>
Mon, 30 Oct 2006 21:01:02 +0000 (21:01 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Mon, 30 Oct 2006 21:01:02 +0000 (21:01 -0000)
* NameValueConfigurationCollection.cs: Implement the Properties
property.

2006-10-30 Joel Reed  <joel.reed@ddiworld.com>

* DirectoryInfo.cs: Implement SearchOption.AllDirectories option.

2006-10-30  <joel.reed@ddiworld.com>

* DirectoryInfoTest.cs: Updated tests to support the DirectoryInfo
SearchOption.AllDirectories

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

mcs/class/System.Configuration/System.Configuration/ChangeLog
mcs/class/System.Configuration/System.Configuration/NameValueConfigurationCollection.cs
mcs/class/corlib/System.IO/ChangeLog
mcs/class/corlib/System.IO/DirectoryInfo.cs
mcs/class/corlib/Test/System.IO/ChangeLog
mcs/class/corlib/Test/System.IO/DirectoryInfoTest.cs

index 468615c6930b4ec9c1527d93345ee30e54d370b0..4da27cc0c22339c71bef3e3c381b514e40163b3a 100644 (file)
@@ -1,3 +1,8 @@
+2006-10-30  Joel Reed <joel.reed@ddiworld.com>
+
+       * NameValueConfigurationCollection.cs: Implement the Properties
+       property. 
+
 2006-08-23  Konstantin Triger <kostat@mainsoft.com>
 
        * ConfigurationLocation.cs: do not read root element, correctly close stream.
index bfabab92a2066b815f932c766b51ffe127fe0417..74158384529b254a553171d01d1964071b6e7a87 100644 (file)
@@ -41,6 +41,13 @@ namespace System.Configuration {
                                           CollectionType = ConfigurationElementCollectionType.AddRemoveClearMap)]
        public sealed class NameValueConfigurationCollection : ConfigurationElementCollection
        {
+               static ConfigurationPropertyCollection properties;
+
+               static NameValueConfigurationCollection ()
+               {
+                       properties = new ConfigurationPropertyCollection ();
+               }
+
                public NameValueConfigurationCollection ()
                {
                }
@@ -62,7 +69,7 @@ namespace System.Configuration {
 
                protected internal override ConfigurationPropertyCollection Properties {
                        get {
-                               throw new NotImplementedException ();
+                               return properties;
                        }
                }
 
index 861872c594a6c11e4039d39549cbd0f3dc981a62..7a90e1f37ef961f7e8f0ce3f80a98648388b3c63 100644 (file)
@@ -1,3 +1,7 @@
+2006-10-30 Joel Reed  <joel.reed@ddiworld.com>
+
+       * DirectoryInfo.cs: Implement SearchOption.AllDirectories option.
+
 2006-10-11  Dick Porter  <dick@ximian.com>
 
        * FileStream.cs: Cope with 2.0 FileShare.Delete values.  Patch by
index b8372743871c76db932c9d8dcd6193040edb293c..ee22e4be55b1c11f572ba97ca40c83edbc738b16 100644 (file)
@@ -203,14 +203,25 @@ namespace System.IO {
 #if NET_2_0
                // additional search methods
 
-               [MonoTODO ("AllDirectories isn't implemented")]
                public DirectoryInfo[] GetDirectories (string pattern, SearchOption searchOption)
                {
                        switch (searchOption) {
                        case SearchOption.TopDirectoryOnly:
                                return GetDirectories (pattern);
                        case SearchOption.AllDirectories:
-                               throw new NotImplementedException ();
+                               Queue workq = new Queue(GetDirectories(pattern));
+                               Queue doneq = new Queue();
+                               while (workq.Count > 0)
+                                       {
+                                               DirectoryInfo cinfo = (DirectoryInfo) workq.Dequeue();
+                                               DirectoryInfo[] cinfoDirs = cinfo.GetDirectories(pattern);
+                                               foreach (DirectoryInfo i in cinfoDirs) workq.Enqueue(i);
+                                               doneq.Enqueue(cinfo);
+                                       }
+
+                               DirectoryInfo[] infos = new DirectoryInfo[doneq.Count];
+                               doneq.CopyTo(infos, 0);
+                               return infos;
                        default:
                                string msg = Locale.GetText ("Invalid enum value '{0}' for '{1}'.", searchOption, "SearchOption");
                                throw new ArgumentOutOfRangeException ("searchOption", msg);
index e5166e5ad3af4d1f3d6316c5464d5278f8f6f107..feca4e033c8ff4fa7d83d5b324d176141b621883 100644 (file)
@@ -1,3 +1,8 @@
+2006-10-30 Joel Reed  <joel.reed@ddiworld.com>
+
+       * DirectoryInfoTest.cs: Updated tests to support the DirectoryInfo
+       SearchOption.AllDirectories
+
 2006-09-24  Raja R Harinath  <harinath@gmail.com>
 
        * FileInfoTest.cs (IsReadOnly): Fix compilation.  Mark as NotWorking.
index 766ad1b17e0b1ef757e4c643973aa6213b93e068..87ecb11ed2712bdd8b05e5dd4556fef18b7df3e0 100644 (file)
-// DirectoryInfoTest.cs - NUnit Test Cases for System.IO.DirectoryInfo class\r
-//\r
-// Authors\r
-//     Ville Palo (vi64pa@koti.soon.fi)\r
-//     Sebastien Pouliot  <sebastien@ximian.com>\r
-// \r
-// (C) 2003 Ville Palo\r
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)\r
-// \r
-\r
-using NUnit.Framework;\r
-using System;\r
-using System.Collections;\r
-using System.IO;\r
-\r
-namespace MonoTests.System.IO\r
-{\r
-       [TestFixture]\r
-       public class DirectoryInfoTest : Assertion\r
-       {\r
-               string TempFolder = Path.Combine (Path.GetTempPath (), "MonoTests.System.IO.Tests");\r
-\r
-               static readonly char DSC = Path.DirectorySeparatorChar;\r
-               string current;\r
-\r
-               [SetUp]\r
-               protected void SetUp ()\r
-               {\r
-                       current = Directory.GetCurrentDirectory ();\r
-                       if (Directory.Exists (TempFolder))\r
-                               Directory.Delete (TempFolder, true);\r
-                       Directory.CreateDirectory (TempFolder);\r
-               }\r
-        \r
-               [TearDown]\r
-               protected void TearDown ()\r
-               {\r
-                       if (Directory.Exists (TempFolder))\r
-                               Directory.Delete (TempFolder, true);\r
-                       Directory.SetCurrentDirectory (current);\r
-               }\r
-        \r
-               [Test]\r
-               public void Ctr ()\r
-               {\r
-                       string path = TempFolder + DSC + "DIT.Ctr.Test";\r
-                       DeleteDir (path);\r
-               \r
-                       FileInfo info = new FileInfo (path);\r
-                       AssertEquals ("test#01", true, info.DirectoryName.EndsWith (".Tests"));\r
-                       AssertEquals ("test#02", false, info.Exists);\r
-                       AssertEquals ("test#03", ".Test", info.Extension);\r
-                       AssertEquals ("test#05", "DIT.Ctr.Test", info.Name);            \r
-               }\r
-\r
-               [Test]\r
-               [ExpectedException(typeof(ArgumentNullException))]\r
-               public void CtorArgumentNullException ()\r
-               {\r
-                       DirectoryInfo info = new DirectoryInfo (null);            \r
-               }\r
-\r
-               [Test]\r
-               [ExpectedException(typeof(ArgumentException))]\r
-               public void CtorArgumentException1 ()\r
-               {\r
-                       DirectoryInfo info = new DirectoryInfo ("");            \r
-               }\r
-\r
-               [Test]\r
-               [ExpectedException(typeof(ArgumentException))]\r
-               public void CtorArgumentException2 ()\r
-               {\r
-                       DirectoryInfo info = new DirectoryInfo ("   ");            \r
-               }\r
-\r
-               [Test]\r
-               [ExpectedException(typeof(ArgumentException))]\r
-               public void CtorArgumentException3 ()\r
-               {\r
-               string path = "";\r
-               foreach (char c in Path.InvalidPathChars) {\r
-                       path += c;\r
-               }\r
-               DirectoryInfo info = new DirectoryInfo (path);\r
-               }\r
-                               \r
-               [Test]\r
-               public void Exists ()\r
-               {\r
-               string path = TempFolder + DSC + "DIT.Exists.Test";\r
-               DeleteDir (path);\r
-            \r
-               try {\r
-                       DirectoryInfo info = new DirectoryInfo (path);\r
-                       AssertEquals ("test#01", false, info.Exists);\r
-            \r
-                       Directory.CreateDirectory (path);\r
-                       AssertEquals ("test#02", false, info.Exists);\r
-                       info = new DirectoryInfo (path);\r
-                       AssertEquals ("test#03", true, info.Exists);            \r
-               } finally {\r
-                       DeleteDir (path);\r
-               }\r
-               }\r
-               \r
-               [Test]\r
-               public void Name ()\r
-               {\r
-                       string path = TempFolder + DSC + "DIT.Name.Test";\r
-                       DeleteDir (path);\r
-                       \r
-                       try {\r
-                               DirectoryInfo info = new DirectoryInfo (path);                          \r
-                               AssertEquals ("test#01", "DIT.Name.Test", info.Name);\r
-                               \r
-                               info = Directory.CreateDirectory (path);\r
-                               AssertEquals ("test#02", "DIT.Name.Test", info.Name);\r
-                               \r
-                               \r
-                       } finally {\r
-                               DeleteDir (path);\r
-                       }                                  \r
-               }\r
-               \r
-               [Test]\r
-               public void Parent ()\r
-               {\r
-                       string path = TempFolder + DSC + "DIT.Parent.Test";\r
-                       DeleteDir (path);\r
-                       \r
-                       try {\r
-                               DirectoryInfo info = new DirectoryInfo (path);\r
-                               AssertEquals ("test#01", "MonoTests.System.IO.Tests", info.Parent.Name);\r
-                               \r
-                               info = Directory.CreateDirectory (path);\r
-                               AssertEquals ("test#02", "MonoTests.System.IO.Tests", info.Parent.Name);\r
-                                                               \r
-                       } finally {\r
-                               DeleteDir (path);\r
-                       }                                               \r
-               }\r
-\r
-               [Test]\r
-               public void Create ()\r
-               {\r
-               string path = TempFolder + DSC + "DIT.Create.Test";\r
-               DeleteDir (path);\r
-            \r
-               try {\r
-                       DirectoryInfo info = new DirectoryInfo (path);\r
-                       AssertEquals ("test#01", false, info.Exists);\r
-                       info.Create ();                \r
-                       AssertEquals ("test#02", false, info.Exists);\r
-                       info = new DirectoryInfo (path);\r
-                       AssertEquals ("test#03", true, info.Exists);\r
-               } finally {\r
-                       DeleteDir (path);\r
-               }\r
-               }\r
-\r
-               [Test]\r
-               public void CreateSubdirectory ()\r
-               {\r
-                       string sub_path = Path.Combine ("test01", "test02");\r
-                       try {\r
-                               DirectoryInfo info = new DirectoryInfo (TempFolder);\r
-                               info.CreateSubdirectory (sub_path);\r
-                               Assert ("test#01", Directory.Exists (Path.Combine (TempFolder, sub_path)));\r
-                       } finally {\r
-                               DeleteDir (Path.Combine (TempFolder, sub_path));\r
-                       }\r
-                               \r
+// DirectoryInfoTest.cs - NUnit Test Cases for System.IO.DirectoryInfo class
+//
+// Authors
+//     Ville Palo (vi64pa@koti.soon.fi)
+//     Sebastien Pouliot  <sebastien@ximian.com>
+// 
+// (C) 2003 Ville Palo
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// 
+
+using NUnit.Framework;
+using System;
+using System.Collections;
+using System.IO;
+
+namespace MonoTests.System.IO
+{
+       [TestFixture]
+       public class DirectoryInfoTest : Assertion
+       {
+               string TempFolder = Path.Combine (Path.GetTempPath (), "MonoTests.System.IO.Tests");
+
+               static readonly char DSC = Path.DirectorySeparatorChar;
+               string current;
+
+               [SetUp]
+               protected void SetUp ()
+               {
+                       current = Directory.GetCurrentDirectory ();
+                       if (Directory.Exists (TempFolder))
+                               Directory.Delete (TempFolder, true);
+                       Directory.CreateDirectory (TempFolder);
+               }
+        
+               [TearDown]
+               protected void TearDown ()
+               {
+                       if (Directory.Exists (TempFolder))
+                               Directory.Delete (TempFolder, true);
+                       Directory.SetCurrentDirectory (current);
+               }
+        
+               [Test]
+               public void Ctr ()
+               {
+                       string path = TempFolder + DSC + "DIT.Ctr.Test";
+                       DeleteDir (path);
+               
+                       FileInfo info = new FileInfo (path);
+                       AssertEquals ("test#01", true, info.DirectoryName.EndsWith (".Tests"));
+                       AssertEquals ("test#02", false, info.Exists);
+                       AssertEquals ("test#03", ".Test", info.Extension);
+                       AssertEquals ("test#05", "DIT.Ctr.Test", info.Name);            
+               }
+
+               [Test]
+               [ExpectedException(typeof(ArgumentNullException))]
+               public void CtorArgumentNullException ()
+               {
+                       DirectoryInfo info = new DirectoryInfo (null);            
+               }
+
+               [Test]
+               [ExpectedException(typeof(ArgumentException))]
+               public void CtorArgumentException1 ()
+               {
+                       DirectoryInfo info = new DirectoryInfo ("");            
+               }
+
+               [Test]
+               [ExpectedException(typeof(ArgumentException))]
+               public void CtorArgumentException2 ()
+               {
+                       DirectoryInfo info = new DirectoryInfo ("   ");            
+               }
+
+               [Test]
+               [ExpectedException(typeof(ArgumentException))]
+               public void CtorArgumentException3 ()
+               {
+               string path = "";
+               foreach (char c in Path.InvalidPathChars) {
+                       path += c;
+               }
+               DirectoryInfo info = new DirectoryInfo (path);
+               }
+                               
+               [Test]
+               public void Exists ()
+               {
+               string path = TempFolder + DSC + "DIT.Exists.Test";
+               DeleteDir (path);
+            
+               try {
+                       DirectoryInfo info = new DirectoryInfo (path);
+                       AssertEquals ("test#01", false, info.Exists);
+            
+                       Directory.CreateDirectory (path);
+                       AssertEquals ("test#02", false, info.Exists);
+                       info = new DirectoryInfo (path);
+                       AssertEquals ("test#03", true, info.Exists);            
+               } finally {
+                       DeleteDir (path);
+               }
+               }
+               
+               [Test]
+               public void Name ()
+               {
+                       string path = TempFolder + DSC + "DIT.Name.Test";
+                       DeleteDir (path);
+                       
+                       try {
+                               DirectoryInfo info = new DirectoryInfo (path);                          
+                               AssertEquals ("test#01", "DIT.Name.Test", info.Name);
+                               
+                               info = Directory.CreateDirectory (path);
+                               AssertEquals ("test#02", "DIT.Name.Test", info.Name);
+                               
+                               
+                       } finally {
+                               DeleteDir (path);
+                       }                                  
+               }
+               
+               [Test]
+               public void Parent ()
+               {
+                       string path = TempFolder + DSC + "DIT.Parent.Test";
+                       DeleteDir (path);
+                       
+                       try {
+                               DirectoryInfo info = new DirectoryInfo (path);
+                               AssertEquals ("test#01", "MonoTests.System.IO.Tests", info.Parent.Name);
+                               
+                               info = Directory.CreateDirectory (path);
+                               AssertEquals ("test#02", "MonoTests.System.IO.Tests", info.Parent.Name);
+                                                               
+                       } finally {
+                               DeleteDir (path);
+                       }                                               
+               }
+
+               [Test]
+               public void Create ()
+               {
+               string path = TempFolder + DSC + "DIT.Create.Test";
+               DeleteDir (path);
+            
+               try {
+                       DirectoryInfo info = new DirectoryInfo (path);
+                       AssertEquals ("test#01", false, info.Exists);
+                       info.Create ();                
+                       AssertEquals ("test#02", false, info.Exists);
+                       info = new DirectoryInfo (path);
+                       AssertEquals ("test#03", true, info.Exists);
+               } finally {
+                       DeleteDir (path);
+               }
+               }
+
+               [Test]
+               public void CreateSubdirectory ()
+               {
+                       string sub_path = Path.Combine ("test01", "test02");
+                       try {
+                               DirectoryInfo info = new DirectoryInfo (TempFolder);
+                               info.CreateSubdirectory (sub_path);
+                               Assert ("test#01", Directory.Exists (Path.Combine (TempFolder, sub_path)));
+                       } finally {
+                               DeleteDir (Path.Combine (TempFolder, sub_path));
+                       }
+                               
                }
                
                [Test]
@@ -178,83 +178,83 @@ namespace MonoTests.System.IO
                public void CreateSubdirectoryEmptyString ()
                {
                        new DirectoryInfo (".").CreateSubdirectory ("");
-               }\r
-\r
-               [Test]\r
-               public void Delete1 ()\r
-               {\r
-               string path = TempFolder + DSC + "DIT.Delete1.Test";\r
-               DeleteDir (path);\r
-                       \r
-                       try {\r
-                               Directory.CreateDirectory (path);\r
-                               DirectoryInfo info = new DirectoryInfo (path);\r
-                               AssertEquals ("test#01", true, info.Exists);\r
-                               \r
-                               info.Delete ();\r
-                               AssertEquals ("test#02", true, info.Exists);\r
-                               \r
-                               info = new DirectoryInfo (path);\r
-                               AssertEquals ("test#03", false, info.Exists);\r
-                       } finally {\r
-                               DeleteDir (path);\r
-                       }\r
-               }\r
-\r
-               [Test]\r
-               public void Delete2 ()\r
-               {\r
-               string path = TempFolder + DSC + "DIT.Delete2.Test";\r
-               DeleteDir (path);\r
-                       \r
-                       try {\r
-                               Directory.CreateDirectory (path);\r
-                               File.Create (path + DSC + "test").Close ();\r
-                               DirectoryInfo info = new DirectoryInfo (path);\r
-                               AssertEquals ("test#01", true, info.Exists);\r
-                               \r
-                               info.Delete (true);\r
-                               AssertEquals ("test#02", true, info.Exists);\r
-                               \r
-                               info = new DirectoryInfo (path);\r
-                               AssertEquals ("test#03", false, info.Exists);\r
-                       } finally {\r
-                               DeleteDir (path);\r
-                       }\r
-               }\r
-               \r
-               [Test]\r
-               [ExpectedException (typeof (IOException))]\r
-               public void DeleteIOException1 ()\r
-               {\r
-               string path = TempFolder + DSC + "DIT.DeleteIOException1.Test";\r
-               DeleteDir (path);                       \r
-                       \r
-                       try {\r
-                               Directory.CreateDirectory (path);\r
-                               File.Create (path + DSC + "test").Close ();\r
-                               DirectoryInfo info = new DirectoryInfo (path);\r
-                               info.Delete ();\r
-                       } finally {\r
-                               DeleteDir (path);\r
-                       }\r
-               }\r
-\r
-               [Test]\r
-               [ExpectedException (typeof (IOException))]\r
-               public void DeleteIOException2 ()\r
-               {\r
-               string path = TempFolder + DSC + "DIT.DeleteIOException2.Test";\r
-               DeleteDir (path);                       \r
-                       \r
-                       try {\r
-                               Directory.CreateDirectory (path);\r
-                               File.Create (path + DSC + "test").Close ();\r
-                               DirectoryInfo info = new DirectoryInfo (path);\r
-                               info.Delete (false);\r
-                       } finally {\r
-                               DeleteDir (path);\r
-                       }\r
+               }
+
+               [Test]
+               public void Delete1 ()
+               {
+               string path = TempFolder + DSC + "DIT.Delete1.Test";
+               DeleteDir (path);
+                       
+                       try {
+                               Directory.CreateDirectory (path);
+                               DirectoryInfo info = new DirectoryInfo (path);
+                               AssertEquals ("test#01", true, info.Exists);
+                               
+                               info.Delete ();
+                               AssertEquals ("test#02", true, info.Exists);
+                               
+                               info = new DirectoryInfo (path);
+                               AssertEquals ("test#03", false, info.Exists);
+                       } finally {
+                               DeleteDir (path);
+                       }
+               }
+
+               [Test]
+               public void Delete2 ()
+               {
+               string path = TempFolder + DSC + "DIT.Delete2.Test";
+               DeleteDir (path);
+                       
+                       try {
+                               Directory.CreateDirectory (path);
+                               File.Create (path + DSC + "test").Close ();
+                               DirectoryInfo info = new DirectoryInfo (path);
+                               AssertEquals ("test#01", true, info.Exists);
+                               
+                               info.Delete (true);
+                               AssertEquals ("test#02", true, info.Exists);
+                               
+                               info = new DirectoryInfo (path);
+                               AssertEquals ("test#03", false, info.Exists);
+                       } finally {
+                               DeleteDir (path);
+                       }
+               }
+               
+               [Test]
+               [ExpectedException (typeof (IOException))]
+               public void DeleteIOException1 ()
+               {
+               string path = TempFolder + DSC + "DIT.DeleteIOException1.Test";
+               DeleteDir (path);                       
+                       
+                       try {
+                               Directory.CreateDirectory (path);
+                               File.Create (path + DSC + "test").Close ();
+                               DirectoryInfo info = new DirectoryInfo (path);
+                               info.Delete ();
+                       } finally {
+                               DeleteDir (path);
+                       }
+               }
+
+               [Test]
+               [ExpectedException (typeof (IOException))]
+               public void DeleteIOException2 ()
+               {
+               string path = TempFolder + DSC + "DIT.DeleteIOException2.Test";
+               DeleteDir (path);                       
+                       
+                       try {
+                               Directory.CreateDirectory (path);
+                               File.Create (path + DSC + "test").Close ();
+                               DirectoryInfo info = new DirectoryInfo (path);
+                               info.Delete (false);
+                       } finally {
+                               DeleteDir (path);
+                       }
                }
 
                [Test]
@@ -270,7 +270,7 @@ namespace MonoTests.System.IO
 
                        di = new DirectoryInfo ("something" + Path.AltDirectorySeparatorChar);
                        AssertEquals ("AltDirectorySeparatorChar", Path.DirectorySeparatorChar, di.FullName [di.FullName.Length - 1]);
-               }\r
+               }
 
                [Test]
                public void FullName_RootDirectory ()
@@ -288,323 +288,328 @@ namespace MonoTests.System.IO
                                AssertEquals ("FullName-Alt", "/", di.FullName);
                        }
                        AssertNull ("Parent-Alt", di.Parent);
-               }\r
-               \r
-               [Test]\r
-               public void GetDirectories1 ()\r
-               {\r
-                       string path = TempFolder + DSC + "DIT.GetDirectories1.Test";\r
-                       \r
-                       try {\r
-                               DirectoryInfo info = Directory.CreateDirectory (path);\r
-                               AssertEquals ("test#01", 0, info.GetDirectories ().Length);\r
-                               \r
-                               Directory.CreateDirectory (path + DSC + "1");\r
-                               Directory.CreateDirectory (path + DSC + "2");                           \r
-                               File.Create (path + DSC + "filetest").Close ();\r
-                               AssertEquals ("test#02", 2, info.GetDirectories ().Length);\r
-                               \r
-                               Directory.Delete (path + DSC + 2);\r
-                               AssertEquals ("test#02", 1, info.GetDirectories ().Length);                             \r
-                               \r
-                       } finally {\r
-                               DeleteDir (path);\r
-                       }\r
-               }\r
-               \r
-               [Test]\r
-               public void GetDirectories2 ()\r
-               {\r
-                       string path = TempFolder + DSC + "DIT.GetDirectories2.Test";\r
-                       \r
-                       try {\r
-                               DirectoryInfo info = Directory.CreateDirectory (path);\r
-                               AssertEquals ("test#01", 0, info.GetDirectories ("*").Length);\r
-                               \r
-                               Directory.CreateDirectory (path + DSC + "test120");\r
-                               Directory.CreateDirectory (path + DSC + "test210");\r
-                               Directory.CreateDirectory (path + DSC + "atest330");\r
-                               Directory.CreateDirectory (path + DSC + "test220");\r
-                               File.Create (path + DSC + "filetest").Close ();\r
-                               \r
-                               AssertEquals ("test#02", 4, info.GetDirectories ("*").Length);\r
-                               AssertEquals ("test#03", 3, info.GetDirectories ("test*").Length);\r
-                               AssertEquals ("test#04", 2, info.GetDirectories ("test?20").Length);\r
-                               AssertEquals ("test#05", 0, info.GetDirectories ("test?").Length);\r
-                               AssertEquals ("test#06", 0, info.GetDirectories ("test[12]*").Length);\r
-                               AssertEquals ("test#07", 2, info.GetDirectories ("test2*0").Length);\r
-                               AssertEquals ("test#08", 4, info.GetDirectories ("*test*").Length);\r
-                               \r
-                       } finally {\r
-                               DeleteDir (path);\r
-                       }\r
-               }\r
-               \r
-               [Test]\r
-               [ExpectedException (typeof (DirectoryNotFoundException))]               \r
-               public void GetDirectoriesDirectoryNotFoundException1 ()\r
-               {\r
-               string path = TempFolder + DSC + "DIT.GetDirectoriesDirectoryNotFoundException1.Test";\r
-               DeleteDir (path);\r
-                       \r
-                       try {\r
-                               DirectoryInfo info = new DirectoryInfo (path);\r
-                               info.GetDirectories ();\r
-                       } finally {\r
-                               DeleteDir (path);\r
-                       }\r
-               }\r
-\r
-               [Test]\r
-               [ExpectedException (typeof (DirectoryNotFoundException))]               \r
-               public void GetDirectoriesDirectoryNotFoundException2 ()\r
-               {\r
-               string path = TempFolder + DSC + "DIT.GetDirectoriesDirectoryNotFoundException2.Test";\r
-               DeleteDir (path);\r
-                       \r
-                       try {\r
-                               DirectoryInfo info = new DirectoryInfo (path);\r
-                               info.GetDirectories ("*");\r
-                       } finally {\r
-                               DeleteDir (path);\r
-                       }\r
-               }\r
-               \r
-               [Test]\r
-               [ExpectedException (typeof (ArgumentNullException))]\r
-               public void GetDirectoriesArgumentNullException ()\r
-               {\r
-               string path = TempFolder + DSC + "DIT.GetDirectoriesArgumentNullException.Test";\r
-               DeleteDir (path);\r
-                       \r
-                       try {\r
-                               DirectoryInfo info = new DirectoryInfo (path);\r
-                               info.GetDirectories (null);\r
-                       } finally {\r
-                               DeleteDir (path);\r
-                       }                       \r
-               }\r
-\r
-               [Test]\r
-               public void GetFiles1 ()\r
-               {\r
-               string path = TempFolder + DSC + "DIT.GetFiles1.Test";\r
-               DeleteDir (path);\r
-                       \r
-                       try {\r
-                               DirectoryInfo info = Directory.CreateDirectory (path);\r
-                               AssertEquals ("test#01", 0, info.GetFiles ().Length);\r
-                               File.Create (path + DSC + "file1").Close ();\r
-                               File.Create (path + DSC + "file2").Close ();\r
-                               Directory.CreateDirectory (path + DSC + "directory1");\r
-                               AssertEquals ("test#02", 2, info.GetFiles ().Length);\r
-                                                       \r
-                       } finally {\r
-                               DeleteDir (path);\r
-                       }\r
-               }\r
-               \r
-               [Test]\r
-               public void GetFiles2()\r
-               {\r
-               string path = TempFolder + DSC + "DIT.GetFiles2.Test";\r
-               DeleteDir (path);\r
-                       \r
-                       try {\r
-                               DirectoryInfo info = Directory.CreateDirectory (path);\r
-                               AssertEquals ("test#01", 0, info.GetFiles ("*").Length);\r
-                               File.Create (path + DSC + "file120file").Close ();\r
-                               File.Create (path + DSC + "file220file").Close ();\r
-                               File.Create (path + DSC + "afile330file").Close ();\r
-                               File.Create (path + DSC + "test.abc").Close ();\r
-                               File.Create (path + DSC + "test.abcd").Close ();\r
-                               File.Create (path + DSC + "test.abcdef").Close ();                              \r
-                               Directory.CreateDirectory (path + DSC + "dir");\r
-                               \r
-                               AssertEquals ("test#02", 6, info.GetFiles ("*").Length);\r
-                               AssertEquals ("test#03", 2, info.GetFiles ("file*file").Length);\r
-                               AssertEquals ("test#04", 3, info.GetFiles ("*file*").Length);\r
-                               AssertEquals ("test#05", 2, info.GetFiles ("file?20file").Length);\r
-                               AssertEquals ("test#07", 1, info.GetFiles ("*.abcd").Length);\r
-                               AssertEquals ("test#08", 2, info.GetFiles ("*.abcd*").Length);                                                  \r
-                       } finally {\r
-                               DeleteDir (path);\r
-                       }\r
-               }\r
-               \r
-               [Test]\r
-               [ExpectedException (typeof (DirectoryNotFoundException))]\r
-               public void GetFilesDirectoryNotFoundException1 ()\r
-               {\r
-                       string path = TempFolder + DSC + "DIT.GetFilesDirectoryNotFoundException1.Test";\r
-                       DeleteDir (path);\r
-                       \r
-                       try {\r
-                               DirectoryInfo info = new DirectoryInfo (path);\r
-                               info.GetFiles ();\r
-                               \r
-                       } finally {\r
-                               DeleteDir (path);\r
-                       }\r
-               }\r
-\r
-               [Test]\r
-               [ExpectedException (typeof (DirectoryNotFoundException))]\r
-               public void GetFilesDirectoryNotFoundException2 ()\r
-               {\r
-                       string path = TempFolder + DSC + "DIT.GetFilesDirectoryNotFoundException2.Test";\r
-                       DeleteDir (path);\r
-                       \r
-                       try {\r
-                               DirectoryInfo info = new DirectoryInfo (path);\r
-                               info.GetFiles ("*");\r
-                               \r
-                       } finally {\r
-                               DeleteDir (path);\r
-                       }\r
-               }\r
-               \r
-               [Test]\r
-               [ExpectedException (typeof (ArgumentNullException))]\r
-               public void GetFilesArgumentNullException ()\r
-               {\r
-                       string path = TempFolder + DSC + "DIT.GetFilesArgumentNullException.Test";\r
-                       DeleteDir (path);\r
-                       \r
-                       try {\r
-                               DirectoryInfo info = new DirectoryInfo (path);\r
-                               info.GetFiles (null);                           \r
-                       } finally {\r
-                               DeleteDir (path);\r
-                       }\r
-               }\r
-               \r
-               [Test]\r
-               public void MoveTo ()\r
-               {\r
-                       string path1 = TempFolder + DSC + "DIT.MoveTo.Soucre.Test";\r
-                       string path2 = TempFolder + DSC + "DIT.MoveTo.Dest.Test";\r
-                       DeleteDir (path1);\r
-                       DeleteDir (path2);\r
-                       \r
-                       try {\r
-                               DirectoryInfo info1 = Directory.CreateDirectory (path1);\r
-                               DirectoryInfo info2 = new DirectoryInfo (path2);\r
-                               \r
-                               AssertEquals ("test#01", true, info1.Exists);\r
-                               AssertEquals ("test#02", false, info2.Exists);\r
-                                                                                               \r
-                               info1.MoveTo (path2);                           \r
-                               AssertEquals ("test#03", true, info1.Exists);\r
-                               AssertEquals ("test#04", false, info2.Exists);\r
-                               \r
-                               info1 = new DirectoryInfo (path1);\r
-                               info2 = new DirectoryInfo (path2);\r
-                               AssertEquals ("test#05", false, info1.Exists);\r
-                               AssertEquals ("test#06", true, info2.Exists);\r
-                               \r
-                       } finally {\r
-                               DeleteDir (path1);\r
-                               DeleteDir (path2);\r
-                       }\r
-               }\r
-\r
-               [Test]\r
-               [ExpectedException (typeof (ArgumentNullException))]\r
-               public void MoveToArgumentNullException ()\r
-               {\r
-                       string path = TempFolder + DSC + "DIT.MoveToArgumentNullException.Test";\r
-                       DeleteDir (path);\r
-                       \r
-                       try {\r
-                               DirectoryInfo info = Directory.CreateDirectory (path);\r
-                               info.MoveTo (null);\r
-                       } finally {\r
-                               DeleteDir (path);\r
-                       }\r
-                       \r
-               }\r
-\r
-               [Test]\r
-               [ExpectedException (typeof (IOException))]\r
-               public void MoveToIOException1 ()\r
-               {\r
-                       string path = TempFolder + DSC + "DIT.MoveToIOException1.Test";\r
-                       DeleteDir (path);\r
-                       \r
-                       try {\r
-                               DirectoryInfo info = Directory.CreateDirectory (path);\r
-                               info.MoveTo (path);\r
-                       } finally {\r
-                               DeleteDir (path);\r
-                       }                       \r
-               }\r
-\r
-               [Test]\r
-               [ExpectedException (typeof (ArgumentException))]\r
-               public void MoveToArgumentException1 ()\r
-               {\r
-                       string path = TempFolder + DSC + "DIT.MoveToArgumentException1.Test";\r
-                       DeleteDir (path);\r
-                       \r
-                       try {\r
-                               DirectoryInfo info = Directory.CreateDirectory (path);\r
-                               info.MoveTo ("");\r
-                       } finally {\r
-                               DeleteDir (path);\r
-                       }                       \r
-               }\r
-\r
-               [Test]\r
-               [ExpectedException (typeof (ArgumentException))]\r
-               public void MoveToArgumentException2 ()\r
-               {\r
-                       string path = TempFolder + DSC + "DIT.MoveToArgumentException2.Test";\r
-                       DeleteDir (path);\r
-                       \r
-                       try {\r
-                               DirectoryInfo info = Directory.CreateDirectory (path);\r
-                               info.MoveTo ("    ");\r
-                       } finally {\r
-                               DeleteDir (path);\r
-                       }                       \r
-               }\r
-\r
-               [Test]\r
-               [ExpectedException (typeof (ArgumentException))]\r
-               public void MoveToArgumentException3 ()\r
-               {\r
-                       string path = TempFolder + DSC + "DIT.MoveToArgumentException3.Test";\r
-                       DeleteDir (path);\r
-                       \r
-                       try {\r
-                               DirectoryInfo info = Directory.CreateDirectory (path);\r
-                               info.MoveTo (Path.InvalidPathChars [0].ToString ());\r
-                       } finally {\r
-                               DeleteDir (path);\r
-                       }                       \r
-               }\r
-\r
-               [Test]\r
-               [ExpectedException (typeof (IOException))]\r
-               public void MoveToIOException2 ()\r
-               {\r
-                       string path = TempFolder + DSC + "DIT.MoveToIOException2.Test";\r
-                       DeleteDir (path);\r
-                       \r
-                       try {\r
-                               DirectoryInfo info = new DirectoryInfo (path);\r
-                               info.MoveTo (path);\r
-                       } finally {\r
-                               DeleteDir (path);\r
-                       }                       \r
-               }\r
-\r
-               private void DeleteDir (string path)\r
-               {\r
-                       if (Directory.Exists (path))\r
-                               Directory.Delete (path, true);\r
-               }\r
+               }
+               
+               [Test]
+               public void GetDirectories1 ()
+               {
+                       string path = TempFolder + DSC + "DIT.GetDirectories1.Test";
+                       
+                       try {
+                               DirectoryInfo info = Directory.CreateDirectory (path);
+                               AssertEquals ("test#01", 0, info.GetDirectories ().Length);
+                               
+                               Directory.CreateDirectory (path + DSC + "1");
+                               Directory.CreateDirectory (path + DSC + "2");                           
+                               File.Create (path + DSC + "filetest").Close ();
+                               AssertEquals ("test#02", 2, info.GetDirectories ().Length);
+                               
+                               Directory.Delete (path + DSC + 2);
+                               AssertEquals ("test#02", 1, info.GetDirectories ().Length);                             
+                               
+                       } finally {
+                               DeleteDir (path);
+                       }
+               }
+               
+               [Test]
+               public void GetDirectories2 ()
+               {
+                       string path = TempFolder + DSC + "DIT.GetDirectories2.Test";
+                       
+                       try {
+                               DirectoryInfo info = Directory.CreateDirectory (path);
+                               AssertEquals ("test#01", 0, info.GetDirectories ("*").Length);
+                               
+                               Directory.CreateDirectory (path + DSC + "test120");
+                               Directory.CreateDirectory (path + DSC + "test210");
+                               Directory.CreateDirectory (path + DSC + "atest330");
+                               Directory.CreateDirectory (path + DSC + "test220");
+                               Directory.CreateDirectory (path + DSC + "rest");
+                               Directory.CreateDirectory (path + DSC + "rest" + DSC + "subdir");
+                               File.Create (path + DSC + "filetest").Close ();
+                               
+                               AssertEquals ("test#02", 5, info.GetDirectories ("*").Length);
+                               AssertEquals ("test#03", 3, info.GetDirectories ("test*").Length);
+                               AssertEquals ("test#04", 2, info.GetDirectories ("test?20").Length);
+                               AssertEquals ("test#05", 0, info.GetDirectories ("test?").Length);
+                               AssertEquals ("test#06", 0, info.GetDirectories ("test[12]*").Length);
+                               AssertEquals ("test#07", 2, info.GetDirectories ("test2*0").Length);
+                               AssertEquals ("test#08", 4, info.GetDirectories ("*test*").Length);
+#if NET_2_0
+                               AssertEquals ("test#09", 6, info.GetDirectories ("*", SearchOption.AllDirectories).Length);
+#endif
+                               
+                       } finally {
+                               DeleteDir (path);
+                       }
+               }
+               
+               [Test]
+               [ExpectedException (typeof (DirectoryNotFoundException))]               
+               public void GetDirectoriesDirectoryNotFoundException1 ()
+               {
+               string path = TempFolder + DSC + "DIT.GetDirectoriesDirectoryNotFoundException1.Test";
+               DeleteDir (path);
+                       
+                       try {
+                               DirectoryInfo info = new DirectoryInfo (path);
+                               info.GetDirectories ();
+                       } finally {
+                               DeleteDir (path);
+                       }
+               }
+
+               [Test]
+               [ExpectedException (typeof (DirectoryNotFoundException))]               
+               public void GetDirectoriesDirectoryNotFoundException2 ()
+               {
+               string path = TempFolder + DSC + "DIT.GetDirectoriesDirectoryNotFoundException2.Test";
+               DeleteDir (path);
+                       
+                       try {
+                               DirectoryInfo info = new DirectoryInfo (path);
+                               info.GetDirectories ("*");
+                       } finally {
+                               DeleteDir (path);
+                       }
+               }
+               
+               [Test]
+               [ExpectedException (typeof (ArgumentNullException))]
+               public void GetDirectoriesArgumentNullException ()
+               {
+               string path = TempFolder + DSC + "DIT.GetDirectoriesArgumentNullException.Test";
+               DeleteDir (path);
+                       
+                       try {
+                               DirectoryInfo info = new DirectoryInfo (path);
+                               info.GetDirectories (null);
+                       } finally {
+                               DeleteDir (path);
+                       }                       
+               }
+
+               [Test]
+               public void GetFiles1 ()
+               {
+               string path = TempFolder + DSC + "DIT.GetFiles1.Test";
+               DeleteDir (path);
+                       
+                       try {
+                               DirectoryInfo info = Directory.CreateDirectory (path);
+                               AssertEquals ("test#01", 0, info.GetFiles ().Length);
+                               File.Create (path + DSC + "file1").Close ();
+                               File.Create (path + DSC + "file2").Close ();
+                               Directory.CreateDirectory (path + DSC + "directory1");
+                               AssertEquals ("test#02", 2, info.GetFiles ().Length);
+                                                       
+                       } finally {
+                               DeleteDir (path);
+                       }
+               }
+               
+               [Test]
+               public void GetFiles2()
+               {
+               string path = TempFolder + DSC + "DIT.GetFiles2.Test";
+               DeleteDir (path);
+                       
+                       try {
+                               DirectoryInfo info = Directory.CreateDirectory (path);
+                               AssertEquals ("test#01", 0, info.GetFiles ("*").Length);
+                               File.Create (path + DSC + "file120file").Close ();
+                               File.Create (path + DSC + "file220file").Close ();
+                               File.Create (path + DSC + "afile330file").Close ();
+                               File.Create (path + DSC + "test.abc").Close ();
+                               File.Create (path + DSC + "test.abcd").Close ();
+                               File.Create (path + DSC + "test.abcdef").Close ();                              
+                               Directory.CreateDirectory (path + DSC + "dir");
+                               
+                               AssertEquals ("test#02", 6, info.GetFiles ("*").Length);
+                               AssertEquals ("test#03", 2, info.GetFiles ("file*file").Length);
+                               AssertEquals ("test#04", 3, info.GetFiles ("*file*").Length);
+                               AssertEquals ("test#05", 2, info.GetFiles ("file?20file").Length);
+                               AssertEquals ("test#07", 1, info.GetFiles ("*.abcd").Length);
+                               AssertEquals ("test#08", 2, info.GetFiles ("*.abcd*").Length);                                                  
+                       } finally {
+                               DeleteDir (path);
+                       }
+               }
+               
+               [Test]
+               [ExpectedException (typeof (DirectoryNotFoundException))]
+               public void GetFilesDirectoryNotFoundException1 ()
+               {
+                       string path = TempFolder + DSC + "DIT.GetFilesDirectoryNotFoundException1.Test";
+                       DeleteDir (path);
+                       
+                       try {
+                               DirectoryInfo info = new DirectoryInfo (path);
+                               info.GetFiles ();
+                               
+                       } finally {
+                               DeleteDir (path);
+                       }
+               }
+
+               [Test]
+               [ExpectedException (typeof (DirectoryNotFoundException))]
+               public void GetFilesDirectoryNotFoundException2 ()
+               {
+                       string path = TempFolder + DSC + "DIT.GetFilesDirectoryNotFoundException2.Test";
+                       DeleteDir (path);
+                       
+                       try {
+                               DirectoryInfo info = new DirectoryInfo (path);
+                               info.GetFiles ("*");
+                               
+                       } finally {
+                               DeleteDir (path);
+                       }
+               }
+               
+               [Test]
+               [ExpectedException (typeof (ArgumentNullException))]
+               public void GetFilesArgumentNullException ()
+               {
+                       string path = TempFolder + DSC + "DIT.GetFilesArgumentNullException.Test";
+                       DeleteDir (path);
+                       
+                       try {
+                               DirectoryInfo info = new DirectoryInfo (path);
+                               info.GetFiles (null);                           
+                       } finally {
+                               DeleteDir (path);
+                       }
+               }
+               
+               [Test]
+               public void MoveTo ()
+               {
+                       string path1 = TempFolder + DSC + "DIT.MoveTo.Soucre.Test";
+                       string path2 = TempFolder + DSC + "DIT.MoveTo.Dest.Test";
+                       DeleteDir (path1);
+                       DeleteDir (path2);
+                       
+                       try {
+                               DirectoryInfo info1 = Directory.CreateDirectory (path1);
+                               DirectoryInfo info2 = new DirectoryInfo (path2);
+                               
+                               AssertEquals ("test#01", true, info1.Exists);
+                               AssertEquals ("test#02", false, info2.Exists);
+                                                                                               
+                               info1.MoveTo (path2);                           
+                               AssertEquals ("test#03", true, info1.Exists);
+                               AssertEquals ("test#04", false, info2.Exists);
+                               
+                               info1 = new DirectoryInfo (path1);
+                               info2 = new DirectoryInfo (path2);
+                               AssertEquals ("test#05", false, info1.Exists);
+                               AssertEquals ("test#06", true, info2.Exists);
+                               
+                       } finally {
+                               DeleteDir (path1);
+                               DeleteDir (path2);
+                       }
+               }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentNullException))]
+               public void MoveToArgumentNullException ()
+               {
+                       string path = TempFolder + DSC + "DIT.MoveToArgumentNullException.Test";
+                       DeleteDir (path);
+                       
+                       try {
+                               DirectoryInfo info = Directory.CreateDirectory (path);
+                               info.MoveTo (null);
+                       } finally {
+                               DeleteDir (path);
+                       }
+                       
+               }
+
+               [Test]
+               [ExpectedException (typeof (IOException))]
+               public void MoveToIOException1 ()
+               {
+                       string path = TempFolder + DSC + "DIT.MoveToIOException1.Test";
+                       DeleteDir (path);
+                       
+                       try {
+                               DirectoryInfo info = Directory.CreateDirectory (path);
+                               info.MoveTo (path);
+                       } finally {
+                               DeleteDir (path);
+                       }                       
+               }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentException))]
+               public void MoveToArgumentException1 ()
+               {
+                       string path = TempFolder + DSC + "DIT.MoveToArgumentException1.Test";
+                       DeleteDir (path);
+                       
+                       try {
+                               DirectoryInfo info = Directory.CreateDirectory (path);
+                               info.MoveTo ("");
+                       } finally {
+                               DeleteDir (path);
+                       }                       
+               }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentException))]
+               public void MoveToArgumentException2 ()
+               {
+                       string path = TempFolder + DSC + "DIT.MoveToArgumentException2.Test";
+                       DeleteDir (path);
+                       
+                       try {
+                               DirectoryInfo info = Directory.CreateDirectory (path);
+                               info.MoveTo ("    ");
+                       } finally {
+                               DeleteDir (path);
+                       }                       
+               }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentException))]
+               public void MoveToArgumentException3 ()
+               {
+                       string path = TempFolder + DSC + "DIT.MoveToArgumentException3.Test";
+                       DeleteDir (path);
+                       
+                       try {
+                               DirectoryInfo info = Directory.CreateDirectory (path);
+                               info.MoveTo (Path.InvalidPathChars [0].ToString ());
+                       } finally {
+                               DeleteDir (path);
+                       }                       
+               }
+
+               [Test]
+               [ExpectedException (typeof (IOException))]
+               public void MoveToIOException2 ()
+               {
+                       string path = TempFolder + DSC + "DIT.MoveToIOException2.Test";
+                       DeleteDir (path);
+                       
+                       try {
+                               DirectoryInfo info = new DirectoryInfo (path);
+                               info.MoveTo (path);
+                       } finally {
+                               DeleteDir (path);
+                       }                       
+               }
+
+               private void DeleteDir (string path)
+               {
+                       if (Directory.Exists (path))
+                               Directory.Delete (path, true);
+               }
  
                [Test]
                public void DirectoryNameWithSpace ()
@@ -621,157 +626,157 @@ namespace MonoTests.System.IO
                                foreach (FileInfo f in i.GetFiles ()) // This used to throw
                                        dummy = f.Name;
                        }
-               }\r
-\r
-                       [Test]\r
-                       public void LastWriteTime ()\r
-                       {\r
-                               DirectoryInfo info = new DirectoryInfo (TempFolder);\r
-                               info.LastWriteTime = new DateTime (2003, 6, 4, 6, 4, 0);\r
-\r
-                               DateTime time = Directory.GetLastWriteTime (TempFolder);\r
-                               AssertEquals ("test#01", 2003, time.Year);\r
-                               AssertEquals ("test#02", 6, time.Month);\r
-                               AssertEquals ("test#03", 4, time.Day);\r
-                               AssertEquals ("test#04", 6, time.Hour);\r
-                               AssertEquals ("test#05", 4, time.Minute);\r
-                               AssertEquals ("test#06", 0, time.Second);\r
-\r
-                               time = TimeZone.CurrentTimeZone.ToLocalTime (\r
-                                       Directory.GetLastWriteTimeUtc (TempFolder));\r
-                               AssertEquals ("test#07", 2003, time.Year);\r
-                               AssertEquals ("test#08", 6, time.Month);\r
-                               AssertEquals ("test#09", 4, time.Day);\r
-                               AssertEquals ("test#10", 6, time.Hour);\r
-                               AssertEquals ("test#11", 4, time.Minute);\r
-                               AssertEquals ("test#12", 0, time.Second);\r
-                       }\r
-\r
-                       [Test]\r
-                       public void LastWriteTimeUtc ()\r
-                       {\r
-                               DirectoryInfo info = new DirectoryInfo (TempFolder);\r
-                               info.LastWriteTimeUtc = new DateTime (2003, 6, 4, 6, 4, 0);\r
-\r
-                               DateTime time = TimeZone.CurrentTimeZone.ToUniversalTime (\r
-                                       Directory.GetLastWriteTime (TempFolder));\r
-                               AssertEquals ("test#1", 2003, time.Year);\r
-                               AssertEquals ("test#2", 6, time.Month);\r
-                               AssertEquals ("test#3", 4, time.Day);\r
-                               AssertEquals ("test#4", 6, time.Hour);\r
-                               AssertEquals ("test#5", 4, time.Minute);\r
-                               AssertEquals ("test#6", 0, time.Second);\r
-\r
-                               time = Directory.GetLastWriteTimeUtc (TempFolder);\r
-                               AssertEquals ("test#7", 2003, time.Year);\r
-                               AssertEquals ("test#8", 6, time.Month);\r
-                               AssertEquals ("test#9", 4, time.Day);\r
-                               AssertEquals ("test#10", 6, time.Hour);\r
-                               AssertEquals ("test#11", 4, time.Minute);\r
-                               AssertEquals ("test#12", 0, time.Second);\r
-                       }\r
-\r
-                       [Test]\r
-                       public void LastAccessTime ()\r
-                       {\r
-                               DirectoryInfo info = new DirectoryInfo (TempFolder);\r
-                               info.LastAccessTime = DateTime.Now;\r
-                       }\r
-\r
-                       [Test]\r
-                       public void LastAccessTimeUtc ()\r
-                       {\r
-                               DirectoryInfo info = new DirectoryInfo (TempFolder);\r
-                               info.LastAccessTimeUtc = DateTime.Now;\r
-                       }\r
-\r
-                       [Test]\r
-                       public void CreationTime ()\r
-                       {\r
-                               DirectoryInfo info = new DirectoryInfo (TempFolder);\r
-                               info.CreationTime = DateTime.Now;\r
-                       }\r
-\r
-                       [Test]\r
-                       public void CreationTimeUtc ()\r
-                       {\r
-                               DirectoryInfo info = new DirectoryInfo (TempFolder);\r
-                               info.CreationTimeUtc = DateTime.Now;\r
-                       }\r
-\r
-\r
-               private void CheckName (string name)\r
-               {\r
-                       DirectoryInfo di = new DirectoryInfo (name);\r
-                       AssertEquals (name + ".Name", "share", di.Name);\r
-                       AssertEquals (name + ".Parent.Name", "usr", di.Parent.Name);\r
-               }\r
-\r
-               [Test]\r
-               public void Name_Bug76903 ()\r
-               {\r
-                       CheckName ("/usr/share");\r
-                       CheckName ("/usr/share/");\r
-                       CheckName ("/usr/share/.");\r
-                       CheckName ("/usr/share/./");\r
-                       CheckName ("/usr/share/blabla/../");\r
-                       CheckName ("/usr/lib/../share/.");\r
-               }\r
-\r
-               [Test]\r
-               public void Hang_76191 ()\r
-               {\r
-                       // from bug #76191 (hangs on Windows)\r
-                       DirectoryInfo di = new DirectoryInfo (Environment.CurrentDirectory);\r
-                       Stack s = new Stack ();\r
-                       s.Push (di);\r
-                       while (di.Parent != null) {\r
-                               di = di.Parent;\r
-                               s.Push (di);\r
-                       }\r
-                       while (s.Count > 0) {\r
-                               di = (DirectoryInfo) s.Pop ();\r
-                               Assert (di.Name, di.Exists);\r
-                       }\r
-               }\r
-\r
-               private void WindowsParentFullName (string name, string expected)\r
-               {\r
-                       DirectoryInfo di = new DirectoryInfo (name);\r
-                       if (di.Parent == null)\r
-                               AssertNull (name, expected);\r
-                       else\r
-                               AssertEquals (name, expected, di.Parent.FullName);\r
-               }\r
-\r
-               [Test]\r
-               public void WindowsSystem32_76191 ()\r
-               {\r
-                       // check for Unix platforms - see FAQ for more details\r
-                       // http://www.mono-project.com/FAQ:_Technical#How_to_detect_the_execution_platform_.3F\r
-                       int platform = (int) Environment.OSVersion.Platform;\r
-                       if ((platform == 4) || (platform == 128))\r
-                               return;\r
-\r
-                       Directory.SetCurrentDirectory (@"C:\WINDOWS\system32");\r
-                       WindowsParentFullName ("C:", "C:\\WINDOWS");\r
-                       WindowsParentFullName ("C:\\", null);\r
-                       WindowsParentFullName ("C:\\dir", "C:\\");\r
-                       WindowsParentFullName ("C:\\dir\\", "C:\\");\r
-                       WindowsParentFullName ("C:\\dir\\dir", "C:\\dir");\r
-                       WindowsParentFullName ("C:\\dir\\dir\\", "C:\\dir");\r
-               }
-
-               [Test]\r
-               public void Parent_Bug77090 ()\r
-               {
-                       DirectoryInfo di = new DirectoryInfo ("/home");\r
-                       if (Path.DirectorySeparatorChar == '\\') {\r
-                               Assert ("/home parent (Windows path)", di.Parent.Name.EndsWith (":\\"));\r
-                       }\r
-                       else\r
-                               AssertEquals ("/home parent", "/", di.Parent.Name);\r
-                       AssertNull ("/home parent parent", di.Parent.Parent);\r
-               }\r
-       }\r
-}\r
+               }
+
+                       [Test]
+                       public void LastWriteTime ()
+                       {
+                               DirectoryInfo info = new DirectoryInfo (TempFolder);
+                               info.LastWriteTime = new DateTime (2003, 6, 4, 6, 4, 0);
+
+                               DateTime time = Directory.GetLastWriteTime (TempFolder);
+                               AssertEquals ("test#01", 2003, time.Year);
+                               AssertEquals ("test#02", 6, time.Month);
+                               AssertEquals ("test#03", 4, time.Day);
+                               AssertEquals ("test#04", 6, time.Hour);
+                               AssertEquals ("test#05", 4, time.Minute);
+                               AssertEquals ("test#06", 0, time.Second);
+
+                               time = TimeZone.CurrentTimeZone.ToLocalTime (
+                                       Directory.GetLastWriteTimeUtc (TempFolder));
+                               AssertEquals ("test#07", 2003, time.Year);
+                               AssertEquals ("test#08", 6, time.Month);
+                               AssertEquals ("test#09", 4, time.Day);
+                               AssertEquals ("test#10", 6, time.Hour);
+                               AssertEquals ("test#11", 4, time.Minute);
+                               AssertEquals ("test#12", 0, time.Second);
+                       }
+
+                       [Test]
+                       public void LastWriteTimeUtc ()
+                       {
+                               DirectoryInfo info = new DirectoryInfo (TempFolder);
+                               info.LastWriteTimeUtc = new DateTime (2003, 6, 4, 6, 4, 0);
+
+                               DateTime time = TimeZone.CurrentTimeZone.ToUniversalTime (
+                                       Directory.GetLastWriteTime (TempFolder));
+                               AssertEquals ("test#1", 2003, time.Year);
+                               AssertEquals ("test#2", 6, time.Month);
+                               AssertEquals ("test#3", 4, time.Day);
+                               AssertEquals ("test#4", 6, time.Hour);
+                               AssertEquals ("test#5", 4, time.Minute);
+                               AssertEquals ("test#6", 0, time.Second);
+
+                               time = Directory.GetLastWriteTimeUtc (TempFolder);
+                               AssertEquals ("test#7", 2003, time.Year);
+                               AssertEquals ("test#8", 6, time.Month);
+                               AssertEquals ("test#9", 4, time.Day);
+                               AssertEquals ("test#10", 6, time.Hour);
+                               AssertEquals ("test#11", 4, time.Minute);
+                               AssertEquals ("test#12", 0, time.Second);
+                       }
+
+                       [Test]
+                       public void LastAccessTime ()
+                       {
+                               DirectoryInfo info = new DirectoryInfo (TempFolder);
+                               info.LastAccessTime = DateTime.Now;
+                       }
+
+                       [Test]
+                       public void LastAccessTimeUtc ()
+                       {
+                               DirectoryInfo info = new DirectoryInfo (TempFolder);
+                               info.LastAccessTimeUtc = DateTime.Now;
+                       }
+
+                       [Test]
+                       public void CreationTime ()
+                       {
+                               DirectoryInfo info = new DirectoryInfo (TempFolder);
+                               info.CreationTime = DateTime.Now;
+                       }
+
+                       [Test]
+                       public void CreationTimeUtc ()
+                       {
+                               DirectoryInfo info = new DirectoryInfo (TempFolder);
+                               info.CreationTimeUtc = DateTime.Now;
+                       }
+
+
+               private void CheckName (string name)
+               {
+                       DirectoryInfo di = new DirectoryInfo (name);
+                       AssertEquals (name + ".Name", "share", di.Name);
+                       AssertEquals (name + ".Parent.Name", "usr", di.Parent.Name);
+               }
+
+               [Test]
+               public void Name_Bug76903 ()
+               {
+                       CheckName ("/usr/share");
+                       CheckName ("/usr/share/");
+                       CheckName ("/usr/share/.");
+                       CheckName ("/usr/share/./");
+                       CheckName ("/usr/share/blabla/../");
+                       CheckName ("/usr/lib/../share/.");
+               }
+
+               [Test]
+               public void Hang_76191 ()
+               {
+                       // from bug #76191 (hangs on Windows)
+                       DirectoryInfo di = new DirectoryInfo (Environment.CurrentDirectory);
+                       Stack s = new Stack ();
+                       s.Push (di);
+                       while (di.Parent != null) {
+                               di = di.Parent;
+                               s.Push (di);
+                       }
+                       while (s.Count > 0) {
+                               di = (DirectoryInfo) s.Pop ();
+                               Assert (di.Name, di.Exists);
+                       }
+               }
+
+               private void WindowsParentFullName (string name, string expected)
+               {
+                       DirectoryInfo di = new DirectoryInfo (name);
+                       if (di.Parent == null)
+                               AssertNull (name, expected);
+                       else
+                               AssertEquals (name, expected, di.Parent.FullName);
+               }
+
+               [Test]
+               public void WindowsSystem32_76191 ()
+               {
+                       // check for Unix platforms - see FAQ for more details
+                       // http://www.mono-project.com/FAQ:_Technical#How_to_detect_the_execution_platform_.3F
+                       int platform = (int) Environment.OSVersion.Platform;
+                       if ((platform == 4) || (platform == 128))
+                               return;
+
+                       Directory.SetCurrentDirectory (@"C:\WINDOWS\system32");
+                       WindowsParentFullName ("C:", "C:\\WINDOWS");
+                       WindowsParentFullName ("C:\\", null);
+                       WindowsParentFullName ("C:\\dir", "C:\\");
+                       WindowsParentFullName ("C:\\dir\\", "C:\\");
+                       WindowsParentFullName ("C:\\dir\\dir", "C:\\dir");
+                       WindowsParentFullName ("C:\\dir\\dir\\", "C:\\dir");
+               }
+
+               [Test]
+               public void Parent_Bug77090 ()
+               {
+                       DirectoryInfo di = new DirectoryInfo ("/home");
+                       if (Path.DirectorySeparatorChar == '\\') {
+                               Assert ("/home parent (Windows path)", di.Parent.Name.EndsWith (":\\"));
+                       }
+                       else
+                               AssertEquals ("/home parent", "/", di.Parent.Name);
+                       AssertNull ("/home parent parent", di.Parent.Parent);
+               }
+       }
+}