@@ -31,7 +31,7 @@ public void Setup()
3131 public void Cleanup ( )
3232 {
3333 // Clear any test tokens
34- InMemoryOAuthTokenStore . ClearTokens ( _options . ClientId ) ;
34+ _client . ClearOAuthTokens ( _options . ClientId ) ;
3535 }
3636
3737 [ TestMethod ]
@@ -104,7 +104,7 @@ public void OAuthHandler_GetCurrentTokens_WithStoredTokens_ShouldReturnTokens()
104104 AccessToken = "test-token" ,
105105 ClientId = _options . ClientId
106106 } ;
107- InMemoryOAuthTokenStore . SetTokens ( _options . ClientId , expectedTokens ) ;
107+ _client . StoreOAuthTokens ( _options . ClientId , expectedTokens ) ;
108108
109109 // Act
110110 var tokens = handler . GetCurrentTokens ( ) ;
@@ -135,7 +135,7 @@ public void OAuthHandler_HasValidTokens_WithValidTokens_ShouldReturnTrue()
135135 ExpiresAt = DateTime . UtcNow . AddHours ( 1 ) ,
136136 ClientId = _options . ClientId
137137 } ;
138- InMemoryOAuthTokenStore . SetTokens ( _options . ClientId , tokens ) ;
138+ _client . StoreOAuthTokens ( _options . ClientId , tokens ) ;
139139
140140 // Act & Assert
141141 Assert . IsTrue ( handler . HasValidTokens ( ) ) ;
@@ -152,7 +152,7 @@ public void OAuthHandler_HasValidTokens_WithExpiredTokens_ShouldReturnFalse()
152152 ExpiresAt = DateTime . UtcNow . AddMinutes ( - 5 ) ,
153153 ClientId = _options . ClientId
154154 } ;
155- InMemoryOAuthTokenStore . SetTokens ( _options . ClientId , tokens ) ;
155+ _client . StoreOAuthTokens ( _options . ClientId , tokens ) ;
156156
157157 // Act & Assert
158158 Assert . IsFalse ( handler . HasValidTokens ( ) ) ;
@@ -178,7 +178,7 @@ public void OAuthHandler_HasTokens_WithTokens_ShouldReturnTrue()
178178 AccessToken = "test-token" ,
179179 ClientId = _options . ClientId
180180 } ;
181- InMemoryOAuthTokenStore . SetTokens ( _options . ClientId , tokens ) ;
181+ _client . StoreOAuthTokens ( _options . ClientId , tokens ) ;
182182
183183 // Act & Assert
184184 Assert . IsTrue ( handler . HasTokens ( ) ) ;
@@ -194,7 +194,7 @@ public void OAuthHandler_ClearTokens_ShouldRemoveTokens()
194194 AccessToken = "test-token" ,
195195 ClientId = _options . ClientId
196196 } ;
197- InMemoryOAuthTokenStore . SetTokens ( _options . ClientId , tokens ) ;
197+ _client . StoreOAuthTokens ( _options . ClientId , tokens ) ;
198198 Assert . IsTrue ( handler . HasTokens ( ) ) ;
199199
200200 // Act
@@ -272,7 +272,7 @@ public void OAuthHandler_GetAuthorizationUrl_ShouldStoreCodeVerifierForPKCE()
272272 handler . GetAuthorizationUrl ( ) ;
273273
274274 // Assert
275- var storedTokens = InMemoryOAuthTokenStore . GetTokens ( _options . ClientId ) ;
275+ var storedTokens = _client . GetOAuthTokens ( _options . ClientId ) ;
276276 Assert . IsNotNull ( storedTokens ) ;
277277 Assert . IsNotNull ( storedTokens . AccessToken ) ; // This is the code verifier
278278 Assert . IsTrue ( PkceHelper . IsValidCodeVerifier ( storedTokens . AccessToken ) ) ;
@@ -413,7 +413,7 @@ public void OAuthHandler_LogoutAsync_WithTokens_ShouldReturnSuccessMessage()
413413 AccessToken = "test-token" ,
414414 ClientId = _options . ClientId
415415 } ;
416- InMemoryOAuthTokenStore . SetTokens ( _options . ClientId , tokens ) ;
416+ _client . StoreOAuthTokens ( _options . ClientId , tokens ) ;
417417
418418 // Act & Assert
419419 try
@@ -443,7 +443,7 @@ public void OAuthHandler_GetAccessToken_WithValidTokens_ShouldReturnAccessToken(
443443 AccessToken = "test-access-token" ,
444444 ClientId = _options . ClientId
445445 } ;
446- InMemoryOAuthTokenStore . SetTokens ( _options . ClientId , tokens ) ;
446+ _client . StoreOAuthTokens ( _options . ClientId , tokens ) ;
447447
448448 // Act
449449 var result = handler . GetAccessToken ( ) ;
@@ -475,7 +475,7 @@ public void OAuthHandler_GetRefreshToken_WithValidTokens_ShouldReturnRefreshToke
475475 RefreshToken = "test-refresh-token" ,
476476 ClientId = _options . ClientId
477477 } ;
478- InMemoryOAuthTokenStore . SetTokens ( _options . ClientId , tokens ) ;
478+ _client . StoreOAuthTokens ( _options . ClientId , tokens ) ;
479479
480480 // Act
481481 var result = handler . GetRefreshToken ( ) ;
@@ -507,7 +507,7 @@ public void OAuthHandler_GetOrganizationUID_WithValidTokens_ShouldReturnOrganiza
507507 OrganizationUid = "test-org-uid" ,
508508 ClientId = _options . ClientId
509509 } ;
510- InMemoryOAuthTokenStore . SetTokens ( _options . ClientId , tokens ) ;
510+ _client . StoreOAuthTokens ( _options . ClientId , tokens ) ;
511511
512512 // Act
513513 var result = handler . GetOrganizationUID ( ) ;
@@ -539,7 +539,7 @@ public void OAuthHandler_GetUserUID_WithValidTokens_ShouldReturnUserUID()
539539 UserUid = "test-user-uid" ,
540540 ClientId = _options . ClientId
541541 } ;
542- InMemoryOAuthTokenStore . SetTokens ( _options . ClientId , tokens ) ;
542+ _client . StoreOAuthTokens ( _options . ClientId , tokens ) ;
543543
544544 // Act
545545 var result = handler . GetUserUID ( ) ;
@@ -572,7 +572,7 @@ public void OAuthHandler_GetTokenExpiryTime_WithValidTokens_ShouldReturnExpiryTi
572572 ExpiresAt = expiryTime ,
573573 ClientId = _options . ClientId
574574 } ;
575- InMemoryOAuthTokenStore . SetTokens ( _options . ClientId , tokens ) ;
575+ _client . StoreOAuthTokens ( _options . ClientId , tokens ) ;
576576
577577 // Act
578578 var result = handler . GetTokenExpiryTime ( ) ;
@@ -605,13 +605,13 @@ public void OAuthHandler_SetAccessToken_WithValidToken_ShouldUpdateTokens()
605605 {
606606 ClientId = _options . ClientId
607607 } ;
608- InMemoryOAuthTokenStore . SetTokens ( _options . ClientId , tokens ) ;
608+ _client . StoreOAuthTokens ( _options . ClientId , tokens ) ;
609609
610610 // Act
611611 handler . SetAccessToken ( "new-access-token" ) ;
612612
613613 // Assert
614- var updatedTokens = InMemoryOAuthTokenStore . GetTokens ( _options . ClientId ) ;
614+ var updatedTokens = _client . GetOAuthTokens ( _options . ClientId ) ;
615615 Assert . AreEqual ( "new-access-token" , updatedTokens . AccessToken ) ;
616616 }
617617
@@ -625,7 +625,7 @@ public void OAuthHandler_SetAccessToken_WithNoExistingTokens_ShouldCreateNewToke
625625 handler . SetAccessToken ( "new-access-token" ) ;
626626
627627 // Assert
628- var tokens = InMemoryOAuthTokenStore . GetTokens ( _options . ClientId ) ;
628+ var tokens = _client . GetOAuthTokens ( _options . ClientId ) ;
629629 Assert . IsNotNull ( tokens ) ;
630630 Assert . AreEqual ( "new-access-token" , tokens . AccessToken ) ;
631631 Assert . AreEqual ( _options . ClientId , tokens . ClientId ) ;
@@ -662,13 +662,13 @@ public void OAuthHandler_SetRefreshToken_WithValidToken_ShouldUpdateTokens()
662662 {
663663 ClientId = _options . ClientId
664664 } ;
665- InMemoryOAuthTokenStore . SetTokens ( _options . ClientId , tokens ) ;
665+ _client . StoreOAuthTokens ( _options . ClientId , tokens ) ;
666666
667667 // Act
668668 handler . SetRefreshToken ( "new-refresh-token" ) ;
669669
670670 // Assert
671- var updatedTokens = InMemoryOAuthTokenStore . GetTokens ( _options . ClientId ) ;
671+ var updatedTokens = _client . GetOAuthTokens ( _options . ClientId ) ;
672672 Assert . AreEqual ( "new-refresh-token" , updatedTokens . RefreshToken ) ;
673673 }
674674
@@ -682,7 +682,7 @@ public void OAuthHandler_SetRefreshToken_WithNoExistingTokens_ShouldCreateNewTok
682682 handler . SetRefreshToken ( "new-refresh-token" ) ;
683683
684684 // Assert
685- var tokens = InMemoryOAuthTokenStore . GetTokens ( _options . ClientId ) ;
685+ var tokens = _client . GetOAuthTokens ( _options . ClientId ) ;
686686 Assert . IsNotNull ( tokens ) ;
687687 Assert . AreEqual ( "new-refresh-token" , tokens . RefreshToken ) ;
688688 Assert . AreEqual ( _options . ClientId , tokens . ClientId ) ;
@@ -719,13 +719,13 @@ public void OAuthHandler_SetOrganizationUID_WithValidUID_ShouldUpdateTokens()
719719 {
720720 ClientId = _options . ClientId
721721 } ;
722- InMemoryOAuthTokenStore . SetTokens ( _options . ClientId , tokens ) ;
722+ _client . StoreOAuthTokens ( _options . ClientId , tokens ) ;
723723
724724 // Act
725725 handler . SetOrganizationUID ( "new-org-uid" ) ;
726726
727727 // Assert
728- var updatedTokens = InMemoryOAuthTokenStore . GetTokens ( _options . ClientId ) ;
728+ var updatedTokens = _client . GetOAuthTokens ( _options . ClientId ) ;
729729 Assert . AreEqual ( "new-org-uid" , updatedTokens . OrganizationUid ) ;
730730 }
731731
@@ -739,7 +739,7 @@ public void OAuthHandler_SetOrganizationUID_WithNoExistingTokens_ShouldCreateNew
739739 handler . SetOrganizationUID ( "new-org-uid" ) ;
740740
741741 // Assert
742- var tokens = InMemoryOAuthTokenStore . GetTokens ( _options . ClientId ) ;
742+ var tokens = _client . GetOAuthTokens ( _options . ClientId ) ;
743743 Assert . IsNotNull ( tokens ) ;
744744 Assert . AreEqual ( "new-org-uid" , tokens . OrganizationUid ) ;
745745 Assert . AreEqual ( _options . ClientId , tokens . ClientId ) ;
@@ -776,13 +776,13 @@ public void OAuthHandler_SetUserUID_WithValidUID_ShouldUpdateTokens()
776776 {
777777 ClientId = _options . ClientId
778778 } ;
779- InMemoryOAuthTokenStore . SetTokens ( _options . ClientId , tokens ) ;
779+ _client . StoreOAuthTokens ( _options . ClientId , tokens ) ;
780780
781781 // Act
782782 handler . SetUserUID ( "new-user-uid" ) ;
783783
784784 // Assert
785- var updatedTokens = InMemoryOAuthTokenStore . GetTokens ( _options . ClientId ) ;
785+ var updatedTokens = _client . GetOAuthTokens ( _options . ClientId ) ;
786786 Assert . AreEqual ( "new-user-uid" , updatedTokens . UserUid ) ;
787787 }
788788
@@ -796,7 +796,7 @@ public void OAuthHandler_SetUserUID_WithNoExistingTokens_ShouldCreateNewTokens()
796796 handler . SetUserUID ( "new-user-uid" ) ;
797797
798798 // Assert
799- var tokens = InMemoryOAuthTokenStore . GetTokens ( _options . ClientId ) ;
799+ var tokens = _client . GetOAuthTokens ( _options . ClientId ) ;
800800 Assert . IsNotNull ( tokens ) ;
801801 Assert . AreEqual ( "new-user-uid" , tokens . UserUid ) ;
802802 Assert . AreEqual ( _options . ClientId , tokens . ClientId ) ;
@@ -833,14 +833,14 @@ public void OAuthHandler_SetTokenExpiryTime_WithValidTime_ShouldUpdateTokens()
833833 {
834834 ClientId = _options . ClientId
835835 } ;
836- InMemoryOAuthTokenStore . SetTokens ( _options . ClientId , tokens ) ;
836+ _client . StoreOAuthTokens ( _options . ClientId , tokens ) ;
837837 var newExpiryTime = DateTime . UtcNow . AddHours ( 2 ) ;
838838
839839 // Act
840840 handler . SetTokenExpiryTime ( newExpiryTime ) ;
841841
842842 // Assert
843- var updatedTokens = InMemoryOAuthTokenStore . GetTokens ( _options . ClientId ) ;
843+ var updatedTokens = _client . GetOAuthTokens ( _options . ClientId ) ;
844844 Assert . AreEqual ( newExpiryTime , updatedTokens . ExpiresAt ) ;
845845 }
846846
@@ -855,7 +855,7 @@ public void OAuthHandler_SetTokenExpiryTime_WithNoExistingTokens_ShouldCreateNew
855855 handler . SetTokenExpiryTime ( newExpiryTime ) ;
856856
857857 // Assert
858- var tokens = InMemoryOAuthTokenStore . GetTokens ( _options . ClientId ) ;
858+ var tokens = _client . GetOAuthTokens ( _options . ClientId ) ;
859859 Assert . IsNotNull ( tokens ) ;
860860 Assert . AreEqual ( newExpiryTime , tokens . ExpiresAt ) ;
861861 Assert . AreEqual ( _options . ClientId , tokens . ClientId ) ;
@@ -963,7 +963,7 @@ public async Task OAuthHandler_LogoutAsync_WithValidTokens_ShouldCallRevocationA
963963 UserUid = "test-user-uid" ,
964964 ClientId = _options . ClientId
965965 } ;
966- InMemoryOAuthTokenStore . SetTokens ( _options . ClientId , tokens ) ;
966+ _client . StoreOAuthTokens ( _options . ClientId , tokens ) ;
967967
968968 // Act & Assert
969969 try
@@ -1002,7 +1002,7 @@ public async Task OAuthHandler_LogoutAsync_ShouldClearTokensAfterSuccessfulRevoc
10021002 UserUid = "test-user-uid" ,
10031003 ClientId = _options . ClientId
10041004 } ;
1005- InMemoryOAuthTokenStore . SetTokens ( _options . ClientId , tokens ) ;
1005+ _client . StoreOAuthTokens ( _options . ClientId , tokens ) ;
10061006
10071007 // Act & Assert
10081008 try
0 commit comments