Skip to content

Commit dfbb355

Browse files
committed
test: 更新单元测试
1 parent 6a90a6b commit dfbb355

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/UnitTest/Components/TimerTest.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone
55

6+
using AngleSharp.Dom;
67
using Timer = BootstrapBlazor.Components.Timer;
78

89
namespace UnitTest.Components;
@@ -135,16 +136,19 @@ public async Task OnCancel_Ok()
135136
var buttons = cut.FindAll(".timer-buttons button");
136137
// pause
137138
Assert.True(buttons[1].ClassList.Contains("btn-warning"));
139+
Assert.Equal("暂停", buttons[1].GetInnerText());
138140
await cut.InvokeAsync(() => buttons[1].Click());
139141
await Task.Delay(500);
140142

141143
// resume
142144
buttons = cut.FindAll(".timer-buttons button");
143145
Assert.True(buttons[1].ClassList.Contains("btn-success"));
146+
Assert.Equal("继续", buttons[1].GetInnerText());
144147
await cut.InvokeAsync(() => buttons[1].Click());
145148

146149
// cancel
147150
buttons = cut.FindAll(".timer-buttons button");
151+
Assert.Equal("取消", buttons[0].GetInnerText());
148152
await cut.InvokeAsync(() => buttons[0].Click());
149153
Assert.True(cancelled);
150154

0 commit comments

Comments
 (0)