Skip to content

Commit 07d63d7

Browse files
committed
test: 更新单元测试
1 parent c3071e2 commit 07d63d7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/UnitTest/Extensions/DirectoryInfoExtensionsTest.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ public void Copy_Ok()
3434
var sourceDirInfo = new DirectoryInfo(sourceDir);
3535
sourceDirInfo.Copy(destDir, true);
3636
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);
3742
}
3843

3944
private static string CreateDir(string dirName)

0 commit comments

Comments
 (0)