@@ -25,7 +25,7 @@ public void Setup()
2525 CallBase = true
2626 } ;
2727 _fakeHttpMessageHandler
28- . Setup ( h => h . Send ( It . IsAny < HttpRequestMessage > ( ) ) )
28+ . Setup ( h => h . Send ( It . IsAny < HttpRequestMessage > ( ) ) )
2929 . Returns ( new HttpResponseMessage
3030 {
3131 Content = new StringContent ( JsonConvert . SerializeObject ( new UserDto
@@ -42,37 +42,43 @@ public void Setup()
4242 }
4343 }
4444 } ) ;
45- _unit = new IdentityProviderClient ( new HttpClient ( _fakeHttpMessageHandler . Object ) , ( ) => new TenantInformation { SystemBaseUri = "http://localhost/" , TenantId = "0" } ) ;
45+ _unit = new IdentityProviderClient ( new IdentityProviderClientOptions
46+ {
47+ HttpClient = new HttpClient ( _fakeHttpMessageHandler . Object ) ,
48+ SystemBaseUri = new Uri ( "http://localhost/" ) ,
49+ TenantInformationCallback = ( ) => new TenantInformation
50+ { SystemBaseUri = "http://localhost/" , TenantId = "0" }
51+ } ) ;
4652 }
47-
53+
4854 [ TestMethod ]
4955 public async Task OneSessionShouldOnlyValidateOnce ( )
5056 {
5157 var claimsUser = await _unit . GetClaimsPrincipalAsync ( "a&1" ) . ConfigureAwait ( false ) ;
5258 Assert . IsNotNull ( claimsUser ) ;
53-
59+
5460 claimsUser = await _unit . GetClaimsPrincipalAsync ( "a&1" ) . ConfigureAwait ( false ) ;
5561 Assert . IsNotNull ( claimsUser ) ;
56-
57- _fakeHttpMessageHandler . Verify ( h => h . Send ( It . IsAny < HttpRequestMessage > ( ) ) , Times . Once ) ;
62+
63+ _fakeHttpMessageHandler . Verify ( h => h . Send ( It . IsAny < HttpRequestMessage > ( ) ) , Times . Once ) ;
5864 }
59-
65+
6066 [ TestMethod ]
6167 public async Task TwoSessionsShouldOnlyValidateOncePerSession ( )
6268 {
6369 var claimsUser = await _unit . GetClaimsPrincipalAsync ( "a&1" ) . ConfigureAwait ( false ) ;
6470 Assert . IsNotNull ( claimsUser ) ;
65-
71+
6672 claimsUser = await _unit . GetClaimsPrincipalAsync ( "a&2" ) . ConfigureAwait ( false ) ;
6773 Assert . IsNotNull ( claimsUser ) ;
68-
74+
6975 claimsUser = await _unit . GetClaimsPrincipalAsync ( "a&1" ) . ConfigureAwait ( false ) ;
7076 Assert . IsNotNull ( claimsUser ) ;
71-
77+
7278 claimsUser = await _unit . GetClaimsPrincipalAsync ( "a&2" ) . ConfigureAwait ( false ) ;
7379 Assert . IsNotNull ( claimsUser ) ;
74-
75- _fakeHttpMessageHandler . Verify ( h => h . Send ( It . IsAny < HttpRequestMessage > ( ) ) , Times . Exactly ( 2 ) ) ;
80+
81+ _fakeHttpMessageHandler . Verify ( h => h . Send ( It . IsAny < HttpRequestMessage > ( ) ) , Times . Exactly ( 2 ) ) ;
7682 }
7783
7884 [ TestMethod ]
0 commit comments