@@ -22,7 +22,7 @@ public void SetUp()
2222 }
2323
2424 [ Test ]
25- public async Task SendRequestAsync_WithoutData_WithValidAccessToken_WithSuccessReponse_ReturnsExpectedResponse ( )
25+ public async Task SendRequestAsync_WithoutData_WithValidAccessToken_WithSuccessResponse_ReturnsExpectedResponse ( )
2626 {
2727 // Arrange
2828 StoreToken ( ) ;
@@ -42,7 +42,7 @@ public async Task SendRequestAsync_WithoutData_WithValidAccessToken_WithSuccessR
4242 }
4343
4444 [ Test ]
45- public async Task SendRequestAsync_WithoutData_WithApiKeyFromStorage_WithSuccessReponse_ReturnsExpectedResponse ( )
45+ public async Task SendRequestAsync_WithoutData_WithApiKeyFromStorage_WithSuccessResponse_ReturnsExpectedResponse ( )
4646 {
4747 // Arrange
4848 StoreApiKey ( ) ;
@@ -59,7 +59,7 @@ public async Task SendRequestAsync_WithoutData_WithApiKeyFromStorage_WithSuccess
5959 }
6060
6161 [ Test ]
62- public async Task SendRequestAsync_WithoutData_WithValidAccessToken_WithFaileReponse_ThrowsExpectedException ( )
62+ public async Task SendRequestAsync_WithoutData_WithValidAccessToken_WithFailedResponse_ThrowsExpectedException ( )
6363 {
6464 // Arrange
6565 StoreToken ( ) ;
@@ -75,7 +75,7 @@ public async Task SendRequestAsync_WithoutData_WithValidAccessToken_WithFaileRep
7575 }
7676
7777 [ Test ]
78- public async Task SendRequestRawAsync_WithoutData_WithValidAccessToken_WithSuccessReponse_ReturnsExpectedResponse ( )
78+ public async Task SendRequestRawAsync_WithoutData_WithValidAccessToken_WithSuccessResponse_ReturnsExpectedResponse ( )
7979 {
8080 // Arrange
8181 StoreToken ( ) ;
@@ -169,7 +169,7 @@ public async Task SendRequestAsync_WithExpiredAccessToken_WithRefreshTokenSucces
169169 public void GetApiKey_WithExistingApiKey_ReturnsApiKey ( )
170170 {
171171 // Arrange
172- AuthorizedServiceCaller sut = CreateService ( authenticationMethod : AuthenticationMethod . ApiKey ) ;
172+ AuthorizedServiceCaller sut = CreateService ( authenticationMethod : AuthenticationMethod . ApiKey , withConfiguredApiKey : true ) ;
173173
174174 // Act
175175 var result = sut . GetApiKey ( ServiceAlias ) ;
@@ -184,7 +184,7 @@ public void GetApiKey_WithStoredApiKey_ReturnsStoredApiKey()
184184 {
185185 // Arrange
186186 StoreApiKey ( ) ;
187- AuthorizedServiceCaller sut = CreateService ( authenticationMethod : AuthenticationMethod . ApiKey ) ;
187+ AuthorizedServiceCaller sut = CreateService ( authenticationMethod : AuthenticationMethod . ApiKey , withConfiguredApiKey : false ) ;
188188
189189 // Act
190190 var result = sut . GetApiKey ( ServiceAlias ) ;
@@ -250,7 +250,8 @@ private AuthorizedServiceCaller CreateService(
250250 HttpStatusCode statusCode = HttpStatusCode . OK ,
251251 string ? responseContent = null ,
252252 HttpStatusCode refreshTokenStatusCode = HttpStatusCode . OK ,
253- AuthenticationMethod authenticationMethod = AuthenticationMethod . OAuth2AuthorizationCode )
253+ AuthenticationMethod authenticationMethod = AuthenticationMethod . OAuth2AuthorizationCode ,
254+ bool withConfiguredApiKey = false )
254255 {
255256 var authorizationRequestSenderMock = new Mock < IAuthorizationRequestSender > ( ) ;
256257
@@ -264,7 +265,7 @@ private AuthorizedServiceCaller CreateService(
264265 . Setup ( x => x . SendRequest ( It . Is < ServiceDetail > ( y => y . Alias == ServiceAlias ) , It . Is < Dictionary < string , string > > ( y => y [ "grant_type" ] == "refresh_token" ) ) )
265266 . ReturnsAsync ( httpResponseMessage ) ;
266267
267- Mock < IOptionsMonitor < ServiceDetail > > optionsMonitorServiceDetailMock = CreateOptionsMonitorServiceDetail ( authenticationMethod ) ;
268+ Mock < IOptionsMonitor < ServiceDetail > > optionsMonitorServiceDetailMock = CreateOptionsMonitorServiceDetail ( authenticationMethod , withConfiguredApiKey ) ;
268269 var factory = new JsonSerializerFactory ( optionsMonitorServiceDetailMock . Object , new JsonNetSerializer ( ) ) ;
269270
270271 return new AuthorizedServiceCaller (
0 commit comments