@@ -2360,6 +2360,7 @@ public async Task CustomerToolbarPopConfirmButton_Ok()
23602360 {
23612361 var clicked = false ;
23622362 var clickCallback = false ;
2363+ var confirmCallback = false ;
23632364 var localizer = Context . Services . GetRequiredService < IStringLocalizer < Foo > > ( ) ;
23642365 var cut = Context . RenderComponent < BootstrapBlazorRoot > ( pb =>
23652366 {
@@ -2390,15 +2391,21 @@ public async Task CustomerToolbarPopConfirmButton_Ok()
23902391 clickCallback = true ;
23912392 return Task . CompletedTask ;
23922393 } ) ) ;
2394+ builder . AddAttribute ( 4 , nameof ( TableToolbarPopConfirmButton < Foo > . OnConfirm ) , new Func < Task > ( ( ) =>
2395+ {
2396+ confirmCallback = true ;
2397+ return Task . CompletedTask ;
2398+ } ) ) ;
23932399 builder . CloseComponent ( ) ;
23942400 } ) ;
23952401 } ) ;
23962402 } ) ;
23972403
23982404 var button = cut . FindComponent < PopConfirmButton > ( ) ;
2399- await cut . InvokeAsync ( ( ) => button . Instance . OnConfirm . Invoke ( ) ) ;
2405+ await cut . InvokeAsync ( ( ) => button . Instance . OnConfirm ! . Invoke ( ) ) ;
24002406 Assert . True ( clickCallback ) ;
24012407 Assert . True ( clicked ) ;
2408+ Assert . True ( confirmCallback ) ;
24022409 }
24032410
24042411 [ Fact ]
@@ -5370,7 +5377,7 @@ public async Task Delete_Ok()
53705377 await cut . InvokeAsync ( input . Instance . OnToggleClick ) ;
53715378
53725379 var button = cut . FindComponent < TableToolbarPopConfirmButton < Foo > > ( ) ;
5373- await cut . InvokeAsync ( ( ) => button . Instance . OnConfirm . Invoke ( ) ) ;
5380+ await cut . InvokeAsync ( ( ) => button . Instance . OnConfirm ! . Invoke ( ) ) ;
53745381 Assert . Single ( items ) ;
53755382 }
53765383
@@ -5420,7 +5427,7 @@ public async Task OnDeleteAsync_Ok()
54205427 await cut . InvokeAsync ( input . Instance . OnToggleClick ) ;
54215428
54225429 var button = cut . FindComponent < TableToolbarPopConfirmButton < Foo > > ( ) ;
5423- await cut . InvokeAsync ( ( ) => button . Instance . OnConfirm . Invoke ( ) ) ;
5430+ await cut . InvokeAsync ( ( ) => button . Instance . OnConfirm ! . Invoke ( ) ) ;
54245431
54255432 var row = cut . FindAll ( "tbody tr" ) ;
54265433 Assert . Single ( row ) ;
@@ -6199,7 +6206,7 @@ public async Task DynamicContext_Add()
61996206 await cut . InvokeAsync ( ( ) => table . Instance . AddAsync ( ) ) ;
62006207
62016208 var delete = cut . FindComponent < TableToolbarPopConfirmButton < DynamicObject > > ( ) ;
6202- await cut . InvokeAsync ( ( ) => delete . Instance . OnConfirm ( ) ) ;
6209+ await cut . InvokeAsync ( ( ) => delete . Instance . OnConfirm ! . Invoke ( ) ) ;
62036210 }
62046211
62056212 [ Fact ]
@@ -6953,13 +6960,13 @@ public void OnConfirm_Ok()
69536960 // 选一个
69546961 var input = cut . FindComponents < Checkbox < Foo > > ( ) [ 1 ] ;
69556962 cut . InvokeAsync ( input . Instance . OnToggleClick ) ;
6956- cut . InvokeAsync ( ( ) => deleteButton . Instance . OnConfirm ( ) ) ;
6963+ cut . InvokeAsync ( ( ) => deleteButton . Instance . OnConfirm ! . Invoke ( ) ) ;
69576964
69586965 table . SetParametersAndRender ( pb =>
69596966 {
69606967 pb . Add ( a => a . PageItemsSource , [ 1 , 2 , 4 , 8 ] ) ;
69616968 } ) ;
6962- cut . InvokeAsync ( ( ) => deleteButton . Instance . OnConfirm ( ) ) ;
6969+ cut . InvokeAsync ( ( ) => deleteButton . Instance . OnConfirm ! . Invoke ( ) ) ;
69636970 }
69646971
69656972 [ Fact ]
@@ -7084,7 +7091,7 @@ public async Task IsExcel_Ok()
70847091 await cut . InvokeAsync ( ( ) => table . Instance . AddAsync ( ) ) ;
70857092
70867093 var delete = cut . FindComponent < TableToolbarPopConfirmButton < Foo > > ( ) ;
7087- await cut . InvokeAsync ( ( ) => delete . Instance . OnConfirm ( ) ) ;
7094+ await cut . InvokeAsync ( ( ) => delete . Instance . OnConfirm ! . Invoke ( ) ) ;
70887095 }
70897096
70907097 [ Fact ]
0 commit comments