@@ -12,12 +12,10 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.Authentication;
1212
1313public class WebAssemblyAuthenticationServiceCollectionExtensionsTests
1414{
15- private static readonly JsonSerializerOptions JsonOptions = new ( ) ;
16-
1715 [ Fact ]
1816 public void CanResolve_AccessTokenProvider ( )
1917 {
20- var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) , JsonOptions ) ;
18+ var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) ) ;
2119 builder . Services . AddApiAuthorization ( ) ;
2220 var host = builder . Build ( ) ;
2321
@@ -27,7 +25,7 @@ public void CanResolve_AccessTokenProvider()
2725 [ Fact ]
2826 public void CanResolve_IRemoteAuthenticationService ( )
2927 {
30- var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) , JsonOptions ) ;
28+ var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) ) ;
3129 builder . Services . AddApiAuthorization ( ) ;
3230 var host = builder . Build ( ) ;
3331
@@ -37,7 +35,7 @@ public void CanResolve_IRemoteAuthenticationService()
3735 [ Fact ]
3836 public void ApiAuthorizationOptions_ConfigurationDefaultsGetApplied ( )
3937 {
40- var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) , JsonOptions ) ;
38+ var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) ) ;
4139 builder . Services . AddApiAuthorization ( ) ;
4240 var host = builder . Build ( ) ;
4341
@@ -71,7 +69,7 @@ public void ApiAuthorizationOptions_ConfigurationDefaultsGetApplied()
7169 [ Fact ]
7270 public void ApiAuthorizationOptionsConfigurationCallback_GetsCalledOnce ( )
7371 {
74- var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) , JsonOptions ) ;
72+ var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) ) ;
7573 var calls = 0 ;
7674 builder . Services . AddApiAuthorization ( options =>
7775 {
@@ -98,7 +96,7 @@ public void ApiAuthorizationOptionsConfigurationCallback_GetsCalledOnce()
9896 [ Fact ]
9997 public void ApiAuthorizationTestAuthenticationState_SetsUpConfiguration ( )
10098 {
101- var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) , JsonOptions ) ;
99+ var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) ) ;
102100 var calls = 0 ;
103101 builder . Services . AddApiAuthorization < TestAuthenticationState > ( options => calls ++ ) ;
104102
@@ -124,7 +122,7 @@ public void ApiAuthorizationTestAuthenticationState_SetsUpConfiguration()
124122 [ Fact ]
125123 public void ApiAuthorizationTestAuthenticationState_NoCallback_SetsUpConfiguration ( )
126124 {
127- var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) , JsonOptions ) ;
125+ var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) ) ;
128126 builder . Services . AddApiAuthorization < TestAuthenticationState > ( ) ;
129127
130128 var host = builder . Build ( ) ;
@@ -147,7 +145,7 @@ public void ApiAuthorizationTestAuthenticationState_NoCallback_SetsUpConfigurati
147145 [ Fact ]
148146 public void ApiAuthorizationCustomAuthenticationStateAndAccount_SetsUpConfiguration ( )
149147 {
150- var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) , JsonOptions ) ;
148+ var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) ) ;
151149 var calls = 0 ;
152150 builder . Services . AddApiAuthorization < TestAuthenticationState , TestAccount > ( options => calls ++ ) ;
153151
@@ -173,7 +171,7 @@ public void ApiAuthorizationCustomAuthenticationStateAndAccount_SetsUpConfigurat
173171 [ Fact ]
174172 public void ApiAuthorizationTestAuthenticationStateAndAccount_NoCallback_SetsUpConfiguration ( )
175173 {
176- var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) , JsonOptions ) ;
174+ var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) ) ;
177175 builder . Services . AddApiAuthorization < TestAuthenticationState , TestAccount > ( ) ;
178176
179177 var host = builder . Build ( ) ;
@@ -196,7 +194,7 @@ public void ApiAuthorizationTestAuthenticationStateAndAccount_NoCallback_SetsUpC
196194 [ Fact ]
197195 public void ApiAuthorizationOptions_DefaultsCanBeOverriden ( )
198196 {
199- var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) , JsonOptions ) ;
197+ var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) ) ;
200198 builder . Services . AddApiAuthorization ( options =>
201199 {
202200 options . AuthenticationPaths . LogInPath = "a" ;
@@ -247,7 +245,7 @@ public void ApiAuthorizationOptions_DefaultsCanBeOverriden()
247245 [ Fact ]
248246 public void OidcOptions_ConfigurationDefaultsGetApplied ( )
249247 {
250- var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) , JsonOptions ) ;
248+ var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) ) ;
251249 builder . Services . Replace ( ServiceDescriptor . Singleton < NavigationManager , TestNavigationManager > ( ) ) ;
252250 builder . Services . AddOidcAuthentication ( options => { } ) ;
253251 var host = builder . Build ( ) ;
@@ -286,7 +284,7 @@ public void OidcOptions_ConfigurationDefaultsGetApplied()
286284 [ Fact ]
287285 public void OidcOptions_DefaultsCanBeOverriden ( )
288286 {
289- var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) , JsonOptions ) ;
287+ var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) ) ;
290288 builder . Services . AddOidcAuthentication ( options =>
291289 {
292290 options . AuthenticationPaths . LogInPath = "a" ;
@@ -348,7 +346,7 @@ public void OidcOptions_DefaultsCanBeOverriden()
348346 [ Fact ]
349347 public void AddOidc_ConfigurationGetsCalledOnce ( )
350348 {
351- var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) , JsonOptions ) ;
349+ var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) ) ;
352350 var calls = 0 ;
353351
354352 builder . Services . AddOidcAuthentication ( options => calls ++ ) ;
@@ -365,7 +363,7 @@ public void AddOidc_ConfigurationGetsCalledOnce()
365363 [ Fact ]
366364 public void AddOidc_CustomState_SetsUpConfiguration ( )
367365 {
368- var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) , JsonOptions ) ;
366+ var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) ) ;
369367 var calls = 0 ;
370368
371369 builder . Services . AddOidcAuthentication < TestAuthenticationState > ( options => options . ProviderOptions . Authority = ( ++ calls ) . ToString ( CultureInfo . InvariantCulture ) ) ;
@@ -387,7 +385,7 @@ public void AddOidc_CustomState_SetsUpConfiguration()
387385 [ Fact ]
388386 public void AddOidc_CustomStateAndAccount_SetsUpConfiguration ( )
389387 {
390- var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) , JsonOptions ) ;
388+ var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) ) ;
391389 var calls = 0 ;
392390
393391 builder . Services . AddOidcAuthentication < TestAuthenticationState , TestAccount > ( options => options . ProviderOptions . Authority = ( ++ calls ) . ToString ( CultureInfo . InvariantCulture ) ) ;
@@ -409,7 +407,7 @@ public void AddOidc_CustomStateAndAccount_SetsUpConfiguration()
409407 [ Fact ]
410408 public void OidcProviderOptionsAndDependencies_NotResolvedFromRootScope ( )
411409 {
412- var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) , JsonOptions ) ;
410+ var builder = new WebAssemblyHostBuilder ( new TestInternalJSImportMethods ( ) ) ;
413411
414412 var calls = 0 ;
415413
0 commit comments