2005-07-04 Sebastien Pouliot <sebastien@ximian.com>
authorSebastien Pouliot <sebastien@ximian.com>
Mon, 4 Jul 2005 17:00:24 +0000 (17:00 -0000)
committerSebastien Pouliot <sebastien@ximian.com>
Mon, 4 Jul 2005 17:00:24 +0000 (17:00 -0000)
* DirectoryInfoTest.cs: Added tests for getting parent of root
directories (using directory separators).

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

mcs/class/corlib/Test/System.IO/ChangeLog
mcs/class/corlib/Test/System.IO/DirectoryInfoTest.cs

index dc38d68656da174fc91e6a3e5d09e088685385e3..7c9bcd968e8e800563056e6f9f5aeacae6e49360 100644 (file)
@@ -1,3 +1,8 @@
+2005-07-04  Sebastien Pouliot  <sebastien@ximian.com>
+
+       * DirectoryInfoTest.cs: Added tests for getting parent of root 
+       directories (using directory separators).
+
 2005-07-02  Sebastien Pouliot  <sebastien@ximian.com>
 
        * DirectoryInfoTest.cs: Added tests for FullName (bug #75443).
index bf33987939eeb44fce25ce6fad524afc465472f2..54d4346d687a0afb9589564444cf6cef17b9eee9 100644 (file)
@@ -251,6 +251,7 @@ namespace MonoTests.System.IO
                public void FullName ()
                {
                        DirectoryInfo di = new DirectoryInfo ("something");
+                       Assert ("Exists", !di.Exists);
                        Assert ("FullName", di.FullName.EndsWith ("something"));
 
                        di = new DirectoryInfo ("something" + Path.DirectorySeparatorChar);
@@ -259,6 +260,24 @@ 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 ()
+               {
+                       DirectoryInfo di = new DirectoryInfo (String.Empty + Path.DirectorySeparatorChar);
+                       if (Path.DirectorySeparatorChar == '/') {
+                               // can't be sure of the root drive under windows
+                               AssertEquals ("FullName", di.FullName, "/");
+                       }
+                       AssertNull ("Parent", di.Parent);
+
+                       di = new DirectoryInfo (String.Empty + Path.AltDirectorySeparatorChar);
+                       if (Path.DirectorySeparatorChar == '/') {
+                               // can't be sure of the root drive under windows
+                               AssertEquals ("FullName-Alt", di.FullName, "/");
+                       }
+                       AssertNull ("Parent-Alt", di.Parent);
+               }\r
                \r
                [Test]\r
                public void GetDirectories1 ()\r