We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c3071e2 commit 07d63d7Copy full SHA for 07d63d7
test/UnitTest/Extensions/DirectoryInfoExtensionsTest.cs
@@ -34,6 +34,11 @@ public void Copy_Ok()
34
var sourceDirInfo = new DirectoryInfo(sourceDir);
35
sourceDirInfo.Copy(destDir, true);
36
Assert.True(Directory.Exists(destDir));
37
+
38
+ // 测试源文件夹不存在的情况
39
+ var sourceDirNotExists = new DirectoryInfo(Path.Combine(rootDir, "notexists"));
40
+ var ex = Assert.Throws<DirectoryNotFoundException>(() => sourceDirNotExists.Copy(destDir, true));
41
+ Assert.NotNull(ex);
42
}
43
44
private static string CreateDir(string dirName)
0 commit comments