@@ -6561,67 +6561,6 @@ public async Task DynamicContext_HeaderCheckGuid_ShowRowCheckboxCallback_Ok()
65616561 Assert . Single ( selectedRows ) ;
65626562 }
65636563
6564- [ Fact ]
6565- public async Task DynamicContext_InCell_Ok ( )
6566- {
6567- var localizer = Context . Services . GetRequiredService < IStringLocalizer < Foo > > ( ) ;
6568- var items = Foo . GenerateFoo ( localizer , 2 ) ;
6569- var cut = Context . Render < BootstrapBlazorRoot > ( pb =>
6570- {
6571- pb . AddChildContent < Table < DynamicObject > > ( pb =>
6572- {
6573- pb . Add ( a => a . RenderMode , TableRenderMode . Table ) ;
6574- pb . Add ( a => a . IsMultipleSelect , true ) ;
6575- pb . Add ( a => a . EditMode , EditMode . InCell ) ;
6576- pb . Add ( a => a . ShowToolbar , true ) ;
6577- pb . Add ( a => a . ShowExtendButtons , true ) ;
6578- pb . Add ( a => a . DynamicContext , CreateDynamicContext ( localizer ) ) ;
6579- } ) ;
6580- } ) ;
6581-
6582- // 选中行
6583- var input = cut . FindComponents < Checkbox < Guid > > ( ) [ 1 ] ;
6584- await cut . InvokeAsync ( input . Instance . OnToggleClick ) ;
6585-
6586- // 点击编辑按钮
6587- var editButton = cut . FindComponents < TableToolbarButton < DynamicObject > > ( ) [ 1 ] ;
6588- await cut . InvokeAsync ( ( ) => editButton . Instance . OnClick . InvokeAsync ( ) ) ;
6589-
6590- // 点击取消按钮
6591- var cancelButton = cut . FindComponents < Button > ( ) . First ( i => i . Instance . Text == "取消" ) ;
6592- await cut . InvokeAsync ( ( ) => cancelButton . Instance . OnClick . InvokeAsync ( ) ) ;
6593- }
6594-
6595- [ Fact ]
6596- public async Task DynamicContext_EditForm_Ok ( )
6597- {
6598- var localizer = Context . Services . GetRequiredService < IStringLocalizer < Foo > > ( ) ;
6599- var items = Foo . GenerateFoo ( localizer , 2 ) ;
6600- var cut = Context . Render < BootstrapBlazorRoot > ( pb =>
6601- {
6602- pb . AddChildContent < Table < DynamicObject > > ( pb =>
6603- {
6604- pb . Add ( a => a . RenderMode , TableRenderMode . Table ) ;
6605- pb . Add ( a => a . IsMultipleSelect , true ) ;
6606- pb . Add ( a => a . EditMode , EditMode . EditForm ) ;
6607- pb . Add ( a => a . ShowToolbar , true ) ;
6608- pb . Add ( a => a . ShowExtendButtons , true ) ;
6609- pb . Add ( a => a . DynamicContext , CreateDynamicContext ( localizer ) ) ;
6610- } ) ;
6611- } ) ;
6612-
6613- // 选中行
6614- var input = cut . FindComponents < Checkbox < Guid > > ( ) [ 1 ] ;
6615- await cut . InvokeAsync ( input . Instance . OnToggleClick ) ;
6616-
6617- // 点击编辑按钮
6618- var editButton = cut . FindComponents < TableToolbarButton < DynamicObject > > ( ) [ 1 ] ;
6619- await cut . InvokeAsync ( ( ) => editButton . Instance . OnClick . InvokeAsync ( ) ) ;
6620-
6621- // 点击取消按钮
6622- var cancelButton = cut . FindComponents < Button > ( ) . First ( i => i . Instance . Text == "取消" ) ;
6623- await cut . InvokeAsync ( ( ) => cancelButton . Instance . OnClick . InvokeAsync ( ) ) ;
6624- }
66256564
66266565 [ Fact ]
66276566 public async Task DynamicContext_ChangeDetection_Ok ( )
@@ -6652,10 +6591,8 @@ public async Task DynamicContext_ChangeDetection_Ok()
66526591 {
66536592 items = cache . Keys . Where ( i => i . Assembly . GetName ( ) . Name == "BootstrapBlazor_DynamicAssembly" ) ;
66546593 }
6655-
6656- // TODO: 目前无法完全保证动态类型不被缓存,后续需要优化
6657- //Assert.NotNull(items);
6658- //Assert.Empty(items);
6594+ Assert . NotNull ( items ) ;
6595+ Assert . Empty ( items ) ;
66596596 }
66606597
66616598 [ Fact ]
@@ -6749,6 +6686,37 @@ public async Task DynamicContext_Edit()
67496686 Assert . True ( saved ) ;
67506687 }
67516688
6689+ [ Fact ]
6690+ public async Task DynamicContext_InCell_Ok ( )
6691+ {
6692+ var localizer = Context . Services . GetRequiredService < IStringLocalizer < Foo > > ( ) ;
6693+ var items = Foo . GenerateFoo ( localizer , 2 ) ;
6694+ var cut = Context . Render < BootstrapBlazorRoot > ( pb =>
6695+ {
6696+ pb . AddChildContent < Table < DynamicObject > > ( pb =>
6697+ {
6698+ pb . Add ( a => a . RenderMode , TableRenderMode . Table ) ;
6699+ pb . Add ( a => a . IsMultipleSelect , true ) ;
6700+ pb . Add ( a => a . EditMode , EditMode . InCell ) ;
6701+ pb . Add ( a => a . ShowToolbar , true ) ;
6702+ pb . Add ( a => a . ShowExtendButtons , true ) ;
6703+ pb . Add ( a => a . DynamicContext , CreateDynamicContext ( localizer ) ) ;
6704+ } ) ;
6705+ } ) ;
6706+
6707+ // 选中行
6708+ var input = cut . FindComponents < Checkbox < Guid > > ( ) [ 1 ] ;
6709+ await cut . InvokeAsync ( input . Instance . OnToggleClick ) ;
6710+
6711+ // 点击编辑按钮
6712+ var editButton = cut . FindComponents < TableToolbarButton < DynamicObject > > ( ) [ 1 ] ;
6713+ await cut . InvokeAsync ( ( ) => editButton . Instance . OnClick . InvokeAsync ( ) ) ;
6714+
6715+ // 点击取消按钮
6716+ var cancelButton = cut . FindComponents < Button > ( ) . First ( i => i . Instance . Text == "取消" ) ;
6717+ await cut . InvokeAsync ( ( ) => cancelButton . Instance . OnClick . InvokeAsync ( ) ) ;
6718+ }
6719+
67526720 [ Fact ]
67536721 public void DynamicContext_Pagination ( )
67546722 {
0 commit comments