public void Test_MoveDirectory() { var storage = new DiskIsolateStorage("Test", baseDirectory); storage.InitStore(); string storePath = Path.Combine(baseDirectory, "Test"); //删除Test目录下的所以文件和文件夹 string[] strDirs = Directory.GetDirectories(storePath); string[] strFiles = Directory.GetFiles(storePath); foreach (var file in strFiles) { File.Delete(file); } foreach (var dir in strDirs) { Directory.Delete(dir, true); } //创建两个目录 storage.CreateDirectory("dir1"); storage.CreateDirectory("dir2"); //把dir2移到dir1中 storage.MoveDirectory("dir2", "dir1/dir2"); var resultPath = Path.Combine(storePath, "dir1/dir2"); Assert.IsTrue(Directory.Exists(resultPath)); }