File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change 77using Bunit . TestDoubles ;
88using Microsoft . AspNetCore . Components . Rendering ;
99using System . Reflection ;
10- using System . Threading . Tasks ;
1110using UnitTest . Misc ;
1211
1312namespace UnitTest . Components ;
@@ -1100,6 +1099,11 @@ public async Task ShowToolbar_Ok()
11001099 await cut . InvokeAsync ( ( ) => button . Click ( ) ) ;
11011100 Assert . True ( clicked ) ;
11021101
1102+ clicked = false ;
1103+ var item = cut . FindComponent < TabItem > ( ) ;
1104+ await cut . InvokeAsync ( ( ) => tab . Instance . Refresh ( item . Instance ) ) ;
1105+ Assert . True ( clicked ) ;
1106+
11031107 tab . SetParametersAndRender ( pb =>
11041108 {
11051109 pb . Add ( a => a . ShowRefreshToolbarButton , false ) ;
@@ -1111,13 +1115,6 @@ public async Task ShowToolbar_Ok()
11111115 pb . Add ( a => a . ShowFullscreenToolbarButton , false ) ;
11121116 } ) ;
11131117 cut . DoesNotContain ( "tabs-nav-toolbar-fs" ) ;
1114-
1115- // 利用反射提高代码覆盖率
1116- var type = Type . GetType ( "BootstrapBlazor.Components.TabItemExtensions, BootstrapBlazor" ) ;
1117- Assert . NotNull ( type ) ;
1118- var mi = type . GetMethod ( "Refresh" , BindingFlags . Static | BindingFlags . Public ) ;
1119- Assert . NotNull ( mi ) ;
1120- mi . Invoke ( null , [ null , null ] ) ;
11211118 }
11221119
11231120 class DisableTabItemButton : ComponentBase
You can’t perform that action at this time.
0 commit comments