Skip to content

Commit 8b8ae5b

Browse files
committed
test: 增加单元测试
1 parent 92354ec commit 8b8ae5b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/UnitTest/Components/CascaderTest.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,16 @@ public void SetDefaultValue_Ok()
173173
pb.Add(a => a.Value, "1");
174174
pb.Add(a => a.ShowFullLevels, false);
175175
});
176-
Assert.Empty(cut.Instance.Value);
176+
177+
// 未提供数据源时 Value 赋值无效
178+
Assert.Null(cut.Instance.Value);
179+
180+
cut.SetParametersAndRender(pb =>
181+
{
182+
pb.Add(a => a.Items, items);
183+
pb.Add(a => a.Value, "3");
184+
pb.Add(a => a.ShowFullLevels, false);
185+
});
177186
}
178187

179188
[Fact]

0 commit comments

Comments
 (0)