Quellcode durchsuchen

2003-05-22 Zoltan Varga <[email protected]>

	* FileTest.cs: Added tests for moving directories.

svn path=/trunk/mcs/; revision=14794
Zoltan Varga vor 22 Jahren
Ursprung
Commit
f1de5fa45c

+ 4 - 0
mcs/class/corlib/Test/System.IO/ChangeLog

@@ -1,3 +1,7 @@
+2003-05-22  Zoltan Varga  <[email protected]>
+
+	* FileTest.cs: Added tests for moving directories.
+
 2003/05/20  Nick Drochak <[email protected]>
 
 	* FileTest.cs:

+ 14 - 0
mcs/class/corlib/Test/System.IO/FileTest.cs

@@ -16,6 +16,7 @@ using System.Threading;
 
 namespace MonoTests.System.IO
 {
+	[TestFixture]
 	public class FileTest : Assertion
 	{
 		static string TempFolder = Path.Combine (Path.GetTempPath (), "MonoTests.System.IO.Tests");
@@ -379,6 +380,19 @@ namespace MonoTests.System.IO
 			File.Move (TempFolder + Path.DirectorySeparatorChar + "bar", TempFolder + Path.DirectorySeparatorChar + "baz");
 			Assert ("File " + TempFolder + Path.DirectorySeparatorChar + "bar should not exist", !File.Exists (TempFolder + Path.DirectorySeparatorChar + "bar"));
 			Assert ("File " + TempFolder + Path.DirectorySeparatorChar + "baz should exist", File.Exists (TempFolder + Path.DirectorySeparatorChar + "baz"));
+
+			// Test moving of directories
+			string dir = Path.Combine (TempFolder, "dir");
+			string dir2 = Path.Combine (TempFolder, "dir2");
+			string dir_foo = Path.Combine (dir, "foo");
+			string dir2_foo = Path.Combine (dir2, "foo");
+
+			Directory.CreateDirectory (dir);
+			File.Create (dir_foo);
+			File.Move (dir, dir2);
+			Assert (!Directory.Exists (dir));
+			Assert (Directory.Exists (dir2));
+			Assert (File.Exists (dir2_foo));
 		}
 
 		[Test]