Test: share related operation in filesystem

This commit is contained in:
HFO4
2020-02-01 14:26:21 +08:00
parent ab739ea07c
commit 8bb2c2b0c5
10 changed files with 257 additions and 4 deletions

View File

@@ -238,3 +238,22 @@ func TestFileSystem_Recycle(t *testing.T) {
t.Error("指针不一致")
}
}
func TestFileSystem_SetTargetByInterface(t *testing.T) {
asserts := assert.New(t)
fs := FileSystem{}
// 目录
{
asserts.NoError(fs.SetTargetByInterface(&model.Folder{}))
asserts.Len(fs.DirTarget, 1)
asserts.Len(fs.FileTarget, 0)
}
// 文件
{
asserts.NoError(fs.SetTargetByInterface(&model.File{}))
asserts.Len(fs.DirTarget, 1)
asserts.Len(fs.FileTarget, 1)
}
}