@@ -8,17 +8,13 @@ namespace UnitTest.Services;
88/// <summary>
99/// MaskService 单元测试
1010/// </summary>
11- public class MaskServiceTest : TestBase
11+ public class MaskServiceTest : BootstrapBlazorTestBase
1212{
1313 [ Fact ]
1414 public async Task Mask_Ok ( )
1515 {
16- var context = new TestContext ( ) ;
17- context . JSInterop . Mode = JSRuntimeMode . Loose ;
18- context . Services . AddBootstrapBlazor ( ) ;
19-
20- var maskService = context . Services . GetRequiredService < MaskService > ( ) ;
21- var cut = context . RenderComponent < BootstrapBlazorRoot > ( pb =>
16+ var maskService = Context . Services . GetRequiredService < MaskService > ( ) ;
17+ var cut = Context . RenderComponent < BootstrapBlazorRoot > ( pb =>
2218 {
2319 pb . AddChildContent < Button > ( pb =>
2420 {
@@ -49,12 +45,8 @@ await maskService.Show(new MaskOption()
4945 [ Fact ]
5046 public async Task Container_Ok ( )
5147 {
52- var context = new TestContext ( ) ;
53- context . JSInterop . Mode = JSRuntimeMode . Loose ;
54- context . Services . AddBootstrapBlazor ( ) ;
55-
56- var maskService = context . Services . GetRequiredService < MaskService > ( ) ;
57- var cut = context . RenderComponent < BootstrapBlazorRoot > ( pb =>
48+ var maskService = Context . Services . GetRequiredService < MaskService > ( ) ;
49+ var cut = Context . RenderComponent < BootstrapBlazorRoot > ( pb =>
5850 {
5951 pb . AddChildContent < Button > ( pb =>
6052 {
@@ -87,12 +79,8 @@ await maskService.Show(new MaskOption()
8779 [ Fact ]
8880 public async Task Show_Component ( )
8981 {
90- var context = new TestContext ( ) ;
91- context . JSInterop . Mode = JSRuntimeMode . Loose ;
92- context . Services . AddBootstrapBlazor ( ) ;
93-
94- var maskService = context . Services . GetRequiredService < MaskService > ( ) ;
95- var cut = context . RenderComponent < BootstrapBlazorRoot > ( pb =>
82+ var maskService = Context . Services . GetRequiredService < MaskService > ( ) ;
83+ var cut = Context . RenderComponent < BootstrapBlazorRoot > ( pb =>
9684 {
9785 pb . AddChildContent < Button > ( pb =>
9886 {
@@ -109,12 +97,8 @@ public async Task Show_Component()
10997 [ Fact ]
11098 public async Task Show_Type ( )
11199 {
112- var context = new TestContext ( ) ;
113- context . JSInterop . Mode = JSRuntimeMode . Loose ;
114- context . Services . AddBootstrapBlazor ( ) ;
115-
116- var maskService = context . Services . GetRequiredService < MaskService > ( ) ;
117- var cut = context . RenderComponent < BootstrapBlazorRoot > ( pb =>
100+ var maskService = Context . Services . GetRequiredService < MaskService > ( ) ;
101+ var cut = Context . RenderComponent < BootstrapBlazorRoot > ( pb =>
118102 {
119103 pb . AddChildContent < Button > ( pb =>
120104 {
0 commit comments