@@ -138,7 +138,7 @@ public void BitbucketHostProvider_IsSupported_HttpResponseMessage(string header,
138
138
[ Theory ]
139
139
[ InlineData ( "https" , DC_SERVER_HOST , "jsquire" , "password" ) ]
140
140
[ InlineData ( "https" , BITBUCKET_DOT_ORG_HOST , "jsquire" , "password" ) ]
141
- public void BitbucketHostProvider_GetCredentialAsync_Succeeds_ForValidStoredBasicAuthAccount ( string protocol , string host , string username , string password )
141
+ public async Task BitbucketHostProvider_GetCredentialAsync_Succeeds_ForValidStoredBasicAuthAccount ( string protocol , string host , string username , string password )
142
142
{
143
143
InputArguments input = MockInput ( protocol , host , username ) ;
144
144
@@ -149,7 +149,7 @@ public void BitbucketHostProvider_GetCredentialAsync_Succeeds_ForValidStoredBasi
149
149
150
150
var provider = new BitbucketHostProvider ( context , bitbucketAuthentication . Object , bitbucketApi . Object ) ;
151
151
152
- var credential = provider . GetCredentialAsync ( input ) ;
152
+ var credential = await provider . GetCredentialAsync ( input ) ;
153
153
154
154
//verify bitbucket.org credentials were validated
155
155
if ( BITBUCKET_DOT_ORG_HOST . Equals ( host ) )
@@ -172,7 +172,7 @@ public void BitbucketHostProvider_GetCredentialAsync_Succeeds_ForValidStoredBasi
172
172
[ Theory ]
173
173
// DC/Server does not currently support OAuth
174
174
[ InlineData ( "https" , BITBUCKET_DOT_ORG_HOST , "jsquire" , "password" ) ]
175
- public void BitbucketHostProvider_GetCredentialAsync_Succeeds_ForValidStoredOAuthAccount ( string protocol , string host , string username , string token )
175
+ public async Task BitbucketHostProvider_GetCredentialAsync_Succeeds_ForValidStoredOAuthAccount ( string protocol , string host , string username , string token )
176
176
{
177
177
InputArguments input = MockInput ( protocol , host , username ) ;
178
178
@@ -183,7 +183,7 @@ public void BitbucketHostProvider_GetCredentialAsync_Succeeds_ForValidStoredOAut
183
183
184
184
var provider = new BitbucketHostProvider ( context , bitbucketAuthentication . Object , bitbucketApi . Object ) ;
185
185
186
- var credential = provider . GetCredentialAsync ( input ) ;
186
+ var credential = await provider . GetCredentialAsync ( input ) ;
187
187
188
188
//verify bitbucket.org credentials were validated
189
189
VerifyValidateOAuthCredentialsRan ( ) ;
@@ -200,7 +200,7 @@ public void BitbucketHostProvider_GetCredentialAsync_Succeeds_ForValidStoredOAut
200
200
[ InlineData ( "https" , DC_SERVER_HOST , "jsquire" , "password" ) ]
201
201
// cloud
202
202
[ InlineData ( "https" , BITBUCKET_DOT_ORG_HOST , "jsquire" , "password" ) ]
203
- public void BitbucketHostProvider_GetCredentialAsync_Succeeds_ForFreshValidBasicAuthAccount ( string protocol , string host , string username , string password )
203
+ public async Task BitbucketHostProvider_GetCredentialAsync_Succeeds_ForFreshValidBasicAuthAccount ( string protocol , string host , string username , string password )
204
204
{
205
205
InputArguments input = MockInput ( protocol , host , username ) ;
206
206
@@ -217,7 +217,7 @@ public void BitbucketHostProvider_GetCredentialAsync_Succeeds_ForFreshValidBasic
217
217
218
218
var provider = new BitbucketHostProvider ( context , bitbucketAuthentication . Object , bitbucketApi . Object ) ;
219
219
220
- var credential = provider . GetCredentialAsync ( input ) ;
220
+ var credential = await provider . GetCredentialAsync ( input ) ;
221
221
222
222
VerifyBasicAuthFlowRan ( password , true , input , credential ) ;
223
223
@@ -227,7 +227,7 @@ public void BitbucketHostProvider_GetCredentialAsync_Succeeds_ForFreshValidBasic
227
227
[ Theory ]
228
228
// DC/Server does not currently support OAuth
229
229
[ InlineData ( "https" , BITBUCKET_DOT_ORG_HOST , "jsquire" , MOCK_ACCESS_TOKEN ) ]
230
- public void BitbucketHostProvider_GetCredentialAsync_Succeeds_ForFreshValid2FAAcccount ( string protocol , string host , string username , string password )
230
+ public async Task BitbucketHostProvider_GetCredentialAsync_Succeeds_ForFreshValid2FAAcccount ( string protocol , string host , string username , string password )
231
231
{
232
232
var input = MockInput ( protocol , host , username ) ;
233
233
@@ -242,7 +242,7 @@ public void BitbucketHostProvider_GetCredentialAsync_Succeeds_ForFreshValid2FAAc
242
242
243
243
var provider = new BitbucketHostProvider ( context , bitbucketAuthentication . Object , bitbucketApi . Object ) ;
244
244
245
- var credential = provider . GetCredentialAsync ( input ) ;
245
+ var credential = await provider . GetCredentialAsync ( input ) ;
246
246
247
247
VerifyOAuthFlowRan ( password , false , true , input , credential , null ) ;
248
248
@@ -254,7 +254,7 @@ public void BitbucketHostProvider_GetCredentialAsync_Succeeds_ForFreshValid2FAAc
254
254
[ InlineData ( "https" , BITBUCKET_DOT_ORG_HOST , "jsquire" , "password" , "basic" ) ]
255
255
[ InlineData ( "https" , BITBUCKET_DOT_ORG_HOST , "jsquire" , "password" , "oauth" ) ]
256
256
// Basic Auth works
257
- public void BitbucketHostProvider_GetCredentialAsync_ForcedAuthMode_IsRespected ( string protocol , string host , string username , string password ,
257
+ public async Task BitbucketHostProvider_GetCredentialAsync_ForcedAuthMode_IsRespected ( string protocol , string host , string username , string password ,
258
258
string preconfiguredAuthModes )
259
259
{
260
260
var input = MockInput ( protocol , host , username ) ;
@@ -271,7 +271,7 @@ public void BitbucketHostProvider_GetCredentialAsync_ForcedAuthMode_IsRespected(
271
271
272
272
var provider = new BitbucketHostProvider ( context , bitbucketAuthentication . Object , bitbucketApi . Object ) ;
273
273
274
- var credential = provider . GetCredentialAsync ( input ) ;
274
+ var credential = await provider . GetCredentialAsync ( input ) ;
275
275
276
276
Assert . NotNull ( credential ) ;
277
277
@@ -301,7 +301,7 @@ public void BitbucketHostProvider_GetCredentialAsync_ForcedAuthMode_IsRespected(
301
301
[ InlineData ( "https" , DC_SERVER_HOST , "jsquire" , "password" , "1" ) ]
302
302
[ InlineData ( "https" , DC_SERVER_HOST , "jsquire" , "password" , "true" ) ]
303
303
[ InlineData ( "https" , DC_SERVER_HOST , "jsquire" , "password" , null ) ]
304
- public void BitbucketHostProvider_GetCredentialAsync_AlwaysRefreshCredentials_IsRespected ( string protocol , string host , string username , string password ,
304
+ public async Task BitbucketHostProvider_GetCredentialAsync_AlwaysRefreshCredentials_IsRespected ( string protocol , string host , string username , string password ,
305
305
string alwaysRefreshCredentials )
306
306
{
307
307
var input = MockInput ( protocol , host , username ) ;
@@ -319,7 +319,7 @@ public void BitbucketHostProvider_GetCredentialAsync_AlwaysRefreshCredentials_Is
319
319
320
320
var provider = new BitbucketHostProvider ( context , bitbucketAuthentication . Object , bitbucketApi . Object ) ;
321
321
322
- var credential = provider . GetCredentialAsync ( input ) ;
322
+ var credential = await provider . GetCredentialAsync ( input ) ;
323
323
324
324
var alwaysRefreshCredentialsBool = "1" . Equals ( alwaysRefreshCredentials )
325
325
|| "on" . Equals ( alwaysRefreshCredentials )
@@ -450,7 +450,7 @@ private static InputArguments MockInput(string protocol, string host, string use
450
450
} ) ;
451
451
}
452
452
453
- private void VerifyBasicAuthFlowRan ( string password , bool expected , InputArguments input , Task < ICredential > credential )
453
+ private void VerifyBasicAuthFlowRan ( string password , bool expected , InputArguments input , ICredential credential )
454
454
{
455
455
Assert . Equal ( expected , credential != null ) ;
456
456
@@ -459,7 +459,7 @@ private void VerifyBasicAuthFlowRan(string password, bool expected, InputArgumen
459
459
bitbucketAuthentication . Verify ( m => m . GetCredentialsAsync ( remoteUri , input . UserName , It . IsAny < AuthenticationModes > ( ) ) , Times . Once ) ;
460
460
}
461
461
462
- private void VerifyInteractiveBasicAuthFlowRan ( string password , InputArguments input , Task < ICredential > credential )
462
+ private void VerifyInteractiveBasicAuthFlowRan ( string password , InputArguments input , ICredential credential )
463
463
{
464
464
var remoteUri = input . GetRemoteUri ( ) ;
465
465
@@ -485,14 +485,14 @@ private void VerifyBasicAuthFlowNeverRan(string password, InputArguments input,
485
485
}
486
486
}
487
487
488
- private void VerifyInteractiveBasicAuthFlowNeverRan ( string password , InputArguments input , Task < ICredential > credential )
488
+ private void VerifyInteractiveBasicAuthFlowNeverRan ( string password , InputArguments input , ICredential credential )
489
489
{
490
490
var remoteUri = input . GetRemoteUri ( ) ;
491
491
492
492
bitbucketAuthentication . Verify ( m => m . GetCredentialsAsync ( remoteUri , input . UserName , It . IsAny < AuthenticationModes > ( ) ) , Times . Never ) ;
493
493
}
494
494
495
- private void VerifyOAuthFlowRan ( string password , bool storedAccount , bool expected , InputArguments input , Task < ICredential > credential ,
495
+ private void VerifyOAuthFlowRan ( string password , bool storedAccount , bool expected , InputArguments input , ICredential credential ,
496
496
string preconfiguredAuthModes )
497
497
{
498
498
Assert . Equal ( expected , credential != null ) ;
@@ -517,7 +517,7 @@ private void VerifyOAuthFlowRan(string password, bool storedAccount, bool expect
517
517
}
518
518
}
519
519
520
- private void VerifyInteractiveOAuthFlowRan ( string password , InputArguments input , System . Threading . Tasks . Task < ICredential > credential )
520
+ private void VerifyInteractiveOAuthFlowRan ( string password , InputArguments input , ICredential credential )
521
521
{
522
522
var remoteUri = input . GetRemoteUri ( ) ;
523
523
@@ -526,7 +526,7 @@ private void VerifyInteractiveOAuthFlowRan(string password, InputArguments input
526
526
527
527
}
528
528
529
- private void VerifyOAuthFlowDidNotRun ( string password , bool expected , InputArguments input , System . Threading . Tasks . Task < ICredential > credential )
529
+ private void VerifyOAuthFlowDidNotRun ( string password , bool expected , InputArguments input , ICredential credential )
530
530
{
531
531
Assert . Equal ( expected , credential != null ) ;
532
532
@@ -542,7 +542,7 @@ private void VerifyOAuthFlowDidNotRun(string password, bool expected, InputArgum
542
542
bitbucketApi . Verify ( m => m . GetUserInformationAsync ( null , MOCK_ACCESS_TOKEN , true ) , Times . Never ) ;
543
543
}
544
544
545
- private void VerifyInteractiveOAuthFlowNeverRan ( InputArguments input , System . Threading . Tasks . Task < ICredential > credential )
545
+ private void VerifyInteractiveOAuthFlowNeverRan ( InputArguments input , ICredential credential )
546
546
{
547
547
var remoteUri = input . GetRemoteUri ( ) ;
548
548
0 commit comments