@@ -38,7 +38,7 @@ public async Task ThumbprintSuccessTest()
3838
3939 // Create ClientCertificateAzureServiceTokenProvider instance
4040 ClientCertificateAzureServiceTokenProvider provider = new ClientCertificateAzureServiceTokenProvider ( Constants . TestAppId ,
41- cert . Thumbprint , CertificateIdentifierType . Thumbprint , Constants . CurrentUserStore , Constants . AzureAdInstance , Constants . TenantId , 0 , mockAuthenticationContext ) ;
41+ cert . Thumbprint , CertificateIdentifierType . Thumbprint , Constants . CurrentUserStore , Constants . AzureAdInstance , Constants . TenantId , 0 , authenticationContext : mockAuthenticationContext ) ;
4242
4343 // Get the token. This will test that ClientCertificateAzureServiceTokenProvider could fetch the cert from CurrentUser store based on thumbprint in the connection string.
4444 var authResult = await provider . GetAuthResultAsync ( Constants . KeyVaultResourceId , Constants . TenantId ) . ConfigureAwait ( false ) ;
@@ -64,7 +64,7 @@ public async Task ThumbprintFailTest()
6464
6565 // Create ClientCertificateAzureServiceTokenProvider instance
6666 ClientCertificateAzureServiceTokenProvider provider = new ClientCertificateAzureServiceTokenProvider ( Constants . TestAppId ,
67- cert . Thumbprint , CertificateIdentifierType . Thumbprint , Constants . CurrentUserStore , Constants . AzureAdInstance , Constants . TenantId , 0 , mockAuthenticationContext ) ;
67+ cert . Thumbprint , CertificateIdentifierType . Thumbprint , Constants . CurrentUserStore , Constants . AzureAdInstance , Constants . TenantId , 0 , authenticationContext : mockAuthenticationContext ) ;
6868
6969 // Ensure exception is thrown when getting the token
7070 var exception = await Assert . ThrowsAsync < AzureServiceTokenProviderException > ( ( ) => provider . GetAuthResultAsync ( Constants . KeyVaultResourceId , Constants . TenantId ) ) ;
@@ -89,12 +89,12 @@ public void ClientIdNullOrEmptyTest()
8989
9090 // Create ClientCertificateAzureServiceTokenProvider instance
9191 var exception = Assert . Throws < ArgumentNullException > ( ( ) => new ClientCertificateAzureServiceTokenProvider ( null ,
92- cert . Thumbprint , CertificateIdentifierType . Thumbprint , Constants . CurrentUserStore , Constants . AzureAdInstance , Constants . TenantId , 0 , mockAuthenticationContext ) ) ;
92+ cert . Thumbprint , CertificateIdentifierType . Thumbprint , Constants . CurrentUserStore , Constants . AzureAdInstance , Constants . TenantId , 0 , authenticationContext : mockAuthenticationContext ) ) ;
9393
9494 Assert . Contains ( Constants . CannotBeNullError , exception . ToString ( ) ) ;
9595
9696 exception = Assert . Throws < ArgumentNullException > ( ( ) => new ClientCertificateAzureServiceTokenProvider ( string . Empty ,
97- cert . Thumbprint , CertificateIdentifierType . Thumbprint , Constants . CurrentUserStore , Constants . AzureAdInstance , Constants . TenantId , 0 , mockAuthenticationContext ) ) ;
97+ cert . Thumbprint , CertificateIdentifierType . Thumbprint , Constants . CurrentUserStore , Constants . AzureAdInstance , Constants . TenantId , 0 , authenticationContext : mockAuthenticationContext ) ) ;
9898
9999 Assert . Contains ( Constants . CannotBeNullError , exception . ToString ( ) ) ;
100100 }
@@ -114,12 +114,12 @@ public void StoreLocationNullOrEmptyTest()
114114
115115 // Create ClientCertificateAzureServiceTokenProvider instance
116116 var exception = Assert . Throws < ArgumentNullException > ( ( ) => new ClientCertificateAzureServiceTokenProvider ( Constants . TestAppId ,
117- cert . Thumbprint , CertificateIdentifierType . Thumbprint , null , Constants . AzureAdInstance , Constants . TenantId , 0 , mockAuthenticationContext ) ) ;
117+ cert . Thumbprint , CertificateIdentifierType . Thumbprint , null , Constants . AzureAdInstance , Constants . TenantId , 0 , authenticationContext : mockAuthenticationContext ) ) ;
118118
119119 Assert . Contains ( Constants . CannotBeNullError , exception . ToString ( ) ) ;
120120
121121 exception = Assert . Throws < ArgumentNullException > ( ( ) => new ClientCertificateAzureServiceTokenProvider ( Constants . TestAppId ,
122- cert . Thumbprint , CertificateIdentifierType . Thumbprint , string . Empty , Constants . AzureAdInstance , Constants . TenantId , 0 , mockAuthenticationContext ) ) ;
122+ cert . Thumbprint , CertificateIdentifierType . Thumbprint , string . Empty , Constants . AzureAdInstance , Constants . TenantId , 0 , authenticationContext : mockAuthenticationContext ) ) ;
123123
124124 Assert . Contains ( Constants . CannotBeNullError , exception . ToString ( ) ) ;
125125 }
@@ -135,12 +135,12 @@ public void CertSubjectNameOrThumbprintNullOrEmptyTest()
135135
136136 // Create ClientCertificateAzureServiceTokenProvider instance
137137 var exception = Assert . Throws < ArgumentNullException > ( ( ) => new ClientCertificateAzureServiceTokenProvider ( Constants . TestAppId ,
138- null , CertificateIdentifierType . Thumbprint , Constants . CurrentUserStore , Constants . AzureAdInstance , Constants . TenantId , 0 , mockAuthenticationContext ) ) ;
138+ null , CertificateIdentifierType . Thumbprint , Constants . CurrentUserStore , Constants . AzureAdInstance , Constants . TenantId , 0 , authenticationContext : mockAuthenticationContext ) ) ;
139139
140140 Assert . Contains ( Constants . CannotBeNullError , exception . ToString ( ) ) ;
141141
142142 exception = Assert . Throws < ArgumentNullException > ( ( ) => new ClientCertificateAzureServiceTokenProvider ( Constants . TestAppId ,
143- string . Empty , CertificateIdentifierType . Thumbprint , Constants . CurrentUserStore , Constants . AzureAdInstance , Constants . TenantId , 0 , mockAuthenticationContext ) ) ;
143+ string . Empty , CertificateIdentifierType . Thumbprint , Constants . CurrentUserStore , Constants . AzureAdInstance , Constants . TenantId , 0 , authenticationContext : mockAuthenticationContext ) ) ;
144144
145145 Assert . Contains ( Constants . CannotBeNullError , exception . ToString ( ) ) ;
146146 }
@@ -160,7 +160,7 @@ public void InvalidStoreLocationTest()
160160
161161 // Create ClientCertificateAzureServiceTokenProvider instance
162162 var exception = Assert . Throws < ArgumentException > ( ( ) => new ClientCertificateAzureServiceTokenProvider ( Constants . TestAppId ,
163- cert . Thumbprint , CertificateIdentifierType . Thumbprint , Constants . InvalidString , Constants . AzureAdInstance , Constants . TenantId , 0 , mockAuthenticationContext ) ) ;
163+ cert . Thumbprint , CertificateIdentifierType . Thumbprint , Constants . InvalidString , Constants . AzureAdInstance , Constants . TenantId , 0 , authenticationContext : mockAuthenticationContext ) ) ;
164164
165165 Assert . Contains ( Constants . InvalidCertLocationError , exception . ToString ( ) ) ;
166166 }
@@ -177,7 +177,7 @@ public async Task SubjectNameSuccessTest()
177177
178178 // Create ClientCertificateAzureServiceTokenProvider instance with a subject name
179179 ClientCertificateAzureServiceTokenProvider provider = new ClientCertificateAzureServiceTokenProvider ( Constants . TestAppId ,
180- cert . Subject , CertificateIdentifierType . SubjectName , Constants . CurrentUserStore , Constants . AzureAdInstance , Constants . TenantId , 0 , mockAuthenticationContext ) ;
180+ cert . Subject , CertificateIdentifierType . SubjectName , Constants . CurrentUserStore , Constants . AzureAdInstance , Constants . TenantId , 0 , authenticationContext : mockAuthenticationContext ) ;
181181
182182 // Get the token. This will test that ClientCertificateAzureServiceTokenProvider could fetch the cert from CurrentUser store based on subject name in the connection string.
183183 var authResult = await provider . GetAuthResultAsync ( Constants . KeyVaultResourceId , string . Empty ) . ConfigureAwait ( false ) ;
@@ -204,7 +204,7 @@ public void CannotAcquireTokenThroughCertTest()
204204
205205 // Create ClientCertificateAzureServiceTokenProvider instance with a subject name
206206 ClientCertificateAzureServiceTokenProvider provider = new ClientCertificateAzureServiceTokenProvider ( Constants . TestAppId ,
207- cert . Subject , CertificateIdentifierType . SubjectName , Constants . CurrentUserStore , Constants . AzureAdInstance , Constants . TenantId , 0 , mockAuthenticationContext ) ;
207+ cert . Subject , CertificateIdentifierType . SubjectName , Constants . CurrentUserStore , Constants . AzureAdInstance , Constants . TenantId , 0 , authenticationContext : mockAuthenticationContext ) ;
208208
209209 // Get the token. This will test that ClientCertificateAzureServiceTokenProvider could fetch the cert from CurrentUser store based on subject name in the connection string.
210210 var exception = Assert . ThrowsAsync < AzureServiceTokenProviderException > ( ( ) => provider . GetAuthResultAsync ( Constants . KeyVaultResourceId , string . Empty ) ) ;
@@ -226,7 +226,7 @@ public async Task CertificateNotFoundTest()
226226 MockAuthenticationContext mockAuthenticationContext = new MockAuthenticationContext ( MockAuthenticationContext . MockAuthenticationContextTestType . AcquireTokenAsyncClientCertificateSuccess ) ;
227227
228228 ClientCertificateAzureServiceTokenProvider provider = new ClientCertificateAzureServiceTokenProvider ( Constants . TestAppId ,
229- Guid . NewGuid ( ) . ToString ( ) , CertificateIdentifierType . SubjectName , Constants . CurrentUserStore , Constants . AzureAdInstance , Constants . TenantId , 0 , mockAuthenticationContext ) ;
229+ Guid . NewGuid ( ) . ToString ( ) , CertificateIdentifierType . SubjectName , Constants . CurrentUserStore , Constants . AzureAdInstance , Constants . TenantId , 0 , authenticationContext : mockAuthenticationContext ) ;
230230
231231 var exception = await Assert . ThrowsAsync < AzureServiceTokenProviderException > ( ( ) => Task . Run ( ( ) => provider . GetAuthResultAsync ( Constants . KeyVaultResourceId , Constants . TenantId ) ) ) ;
232232
@@ -257,7 +257,7 @@ public async Task KeyVaultCertificateSecretIdentifierSuccessTest(bool includeTen
257257
258258 // Create ClientCertificateAzureServiceTokenProvider instance with a subject name
259259 ClientCertificateAzureServiceTokenProvider provider = new ClientCertificateAzureServiceTokenProvider ( Constants . TestAppId ,
260- Constants . TestKeyVaultCertificateSecretIdentifier , CertificateIdentifierType . KeyVaultCertificateSecretIdentifier , null , Constants . AzureAdInstance , tenantIdParam , 0 , mockAuthenticationContext , keyVaultClient ) ;
260+ Constants . TestKeyVaultCertificateSecretIdentifier , CertificateIdentifierType . KeyVaultCertificateSecretIdentifier , null , Constants . AzureAdInstance , tenantIdParam , 0 , authenticationContext : mockAuthenticationContext , keyVaultClient : keyVaultClient ) ;
261261
262262 // Get the token. This will test that ClientCertificateAzureServiceTokenProvider could fetch the cert from CurrentUser store based on subject name in the connection string.
263263 var authResult = await provider . GetAuthResultAsync ( Constants . ArmResourceId , string . Empty ) . ConfigureAwait ( false ) ;
@@ -283,7 +283,7 @@ public async Task KeyVaultCertificateNotFoundTest()
283283
284284 string SecretIdentifier = "https://testbedkeyvault.vault.azure.net/secrets/secret/" ;
285285 ClientCertificateAzureServiceTokenProvider provider = new ClientCertificateAzureServiceTokenProvider ( Constants . TestAppId ,
286- SecretIdentifier , CertificateIdentifierType . KeyVaultCertificateSecretIdentifier , Constants . CurrentUserStore , Constants . AzureAdInstance , Constants . TenantId , 0 , mockAuthenticationContext , keyVaultClient ) ;
286+ SecretIdentifier , CertificateIdentifierType . KeyVaultCertificateSecretIdentifier , Constants . CurrentUserStore , Constants . AzureAdInstance , Constants . TenantId , 0 , authenticationContext : mockAuthenticationContext , keyVaultClient : keyVaultClient ) ;
287287
288288 var exception = await Assert . ThrowsAsync < AzureServiceTokenProviderException > ( ( ) => Task . Run ( ( ) => provider . GetAuthResultAsync ( Constants . ArmResourceId , Constants . TenantId ) ) ) ;
289289
0 commit comments