@@ -37,19 +37,6 @@ public void StopPropagation_Ok()
3737 Assert . Contains ( "data-bb-stop-propagation=\" true\" " , cut . Markup ) ;
3838 }
3939
40- [ Fact ]
41- public async Task SyncStateCallback_Ok ( )
42- {
43- var cut = Context . RenderComponent < Checkbox < bool > > ( builder =>
44- {
45- builder . Add ( a => a . State , CheckboxState . UnChecked ) ;
46- } ) ;
47- Assert . Equal ( CheckboxState . UnChecked , cut . Instance . State ) ;
48-
49- await cut . InvokeAsync ( ( ) => cut . Instance . SyncStateCallback ( CheckboxState . Checked ) ) ;
50- Assert . Equal ( CheckboxState . Checked , cut . Instance . State ) ;
51- }
52-
5340 [ Fact ]
5441 public void ShowAfterLabel_Ok ( )
5542 {
@@ -82,11 +69,11 @@ public async Task Checkbox_OnBeforeStateChanged()
8269 } ) ;
8370 Assert . False ( cut . Instance . Value ) ;
8471
85- await cut . InvokeAsync ( cut . Instance . TriggerOnBeforeStateChanged ) ;
72+ await cut . InvokeAsync ( cut . Instance . TriggerClick ) ;
8673 Assert . True ( cut . Instance . Value ) ;
8774
8875 confirm = false ;
89- await cut . InvokeAsync ( cut . Instance . TriggerOnBeforeStateChanged ) ;
76+ await cut . InvokeAsync ( cut . Instance . TriggerClick ) ;
9077 Assert . True ( cut . Instance . Value ) ;
9178 }
9279
@@ -104,7 +91,7 @@ public void Checkbox_Dispose()
10491
10592 var methodInfo = checkbox . GetType ( ) . GetMethod ( "DisposeAsync" , System . Reflection . BindingFlags . Instance | System . Reflection . BindingFlags . NonPublic ) ;
10693 Assert . NotNull ( methodInfo ) ;
107- methodInfo . Invoke ( checkbox , new object [ ] { false } ) ;
94+ methodInfo . Invoke ( checkbox , [ false ] ) ;
10895 }
10996
11097 [ Fact ]
@@ -410,20 +397,20 @@ public async Task OnMaxSelectedCountExceed_Ok()
410397
411398 await cut . InvokeAsync ( async ( ) =>
412399 {
413- await checkboxes [ 0 ] . Instance . TriggerOnBeforeStateChanged ( ) ;
400+ await checkboxes [ 0 ] . Instance . TriggerClick ( ) ;
414401 } ) ;
415402 Assert . Equal ( CheckboxState . Checked , checkboxes [ 0 ] . Instance . State ) ;
416403
417404 await cut . InvokeAsync ( async ( ) =>
418405 {
419- await checkboxes [ 1 ] . Instance . TriggerOnBeforeStateChanged ( ) ;
406+ await checkboxes [ 1 ] . Instance . TriggerClick ( ) ;
420407 } ) ;
421408 Assert . Equal ( CheckboxState . Checked , checkboxes [ 1 ] . Instance . State ) ;
422409
423410 // 选中第三个由于限制无法选中
424411 await cut . InvokeAsync ( async ( ) =>
425412 {
426- await checkboxes [ 2 ] . Instance . TriggerOnBeforeStateChanged ( ) ;
413+ await checkboxes [ 2 ] . Instance . TriggerClick ( ) ;
427414 } ) ;
428415 Assert . Equal ( CheckboxState . Checked , checkboxes [ 0 ] . Instance . State ) ;
429416 Assert . Equal ( CheckboxState . Checked , checkboxes [ 1 ] . Instance . State ) ;
@@ -434,7 +421,7 @@ await cut.InvokeAsync(async () =>
434421 max = false ;
435422 await cut . InvokeAsync ( async ( ) =>
436423 {
437- await checkboxes [ 0 ] . Instance . TriggerOnBeforeStateChanged ( ) ;
424+ await checkboxes [ 0 ] . Instance . TriggerClick ( ) ;
438425 } ) ;
439426 Assert . Equal ( CheckboxState . UnChecked , checkboxes [ 0 ] . Instance . State ) ;
440427 Assert . Equal ( CheckboxState . Checked , checkboxes [ 1 ] . Instance . State ) ;
0 commit comments