Skip to content

Commit e551c2e

Browse files
committed
test: 更新单元测试
1 parent 63b153d commit e551c2e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/UnitTest/Components/TableTest.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4582,6 +4582,7 @@ public async Task KeepSelectedRows_Ok()
45824582
await cut.InvokeAsync(() => nextBtn.Click());
45834583

45844584
//选中行数为空
4585+
inputs = cut.FindComponents<Checkbox<Foo>>();
45854586
checkboxs = inputs.Count(i => i.Instance.State == CheckboxState.Checked);
45864587
Assert.Equal(0, checkboxs);
45874588

@@ -4593,6 +4594,7 @@ public async Task KeepSelectedRows_Ok()
45934594
await cut.InvokeAsync(input.Instance.OnToggleClick);
45944595

45954596
//加上表头的复选框选中,结果有3项
4597+
inputs = cut.FindComponents<Checkbox<Foo>>();
45964598
checkboxs = inputs.Count(i => i.Instance.State == CheckboxState.Checked);
45974599
Assert.Equal(3, checkboxs);
45984600

@@ -4601,27 +4603,31 @@ public async Task KeepSelectedRows_Ok()
46014603
await cut.InvokeAsync(() => prevBtn.Click());
46024604

46034605
//恢复选中行数为0
4606+
inputs = cut.FindComponents<Checkbox<Foo>>();
46044607
checkboxs = inputs.Count(i => i.Instance.State == CheckboxState.Checked);
46054608
Assert.Equal(0, checkboxs);
46064609

46074610
//点击向前按钮翻页
46084611
await cut.InvokeAsync(() => prevBtn.Click());
46094612

46104613
//恢复选中行数为1
4614+
inputs = cut.FindComponents<Checkbox<Foo>>();
46114615
checkboxs = inputs.Count(i => i.Instance.State == CheckboxState.Checked);
46124616
Assert.Equal(1, checkboxs);
46134617

46144618
//点击向后翻页按钮
46154619
await cut.InvokeAsync(() => nextBtn.Click());
46164620

46174621
//恢复选中行数为0
4622+
inputs = cut.FindComponents<Checkbox<Foo>>();
46184623
checkboxs = inputs.Count(i => i.Instance.State == CheckboxState.Checked);
46194624
Assert.Equal(0, checkboxs);
46204625

46214626
//点击向后翻页按钮
46224627
await cut.InvokeAsync(() => nextBtn.Click());
46234628

46244629
//恢复选中行数为2,加上表头的复选框选中,结果有3项
4630+
inputs = cut.FindComponents<Checkbox<Foo>>();
46254631
checkboxs = inputs.Count(i => i.Instance.State == CheckboxState.Checked);
46264632
Assert.Equal(3, checkboxs);
46274633
}

0 commit comments

Comments
 (0)