13
13
using Azure . Core . TestFramework ;
14
14
using Azure . Storage . Blobs . Models ;
15
15
using Azure . Storage . Blobs . Specialized ;
16
+ using Azure . Storage . Blobs . Tests ;
16
17
using Azure . Storage . Sas ;
17
18
using Azure . Storage . Shared ;
18
19
using Azure . Storage . Test ;
@@ -78,11 +79,11 @@ public void Ctor_Uri()
78
79
public void Ctor_TokenAuth_Http ( )
79
80
{
80
81
// Arrange
81
- Uri httpUri = new Uri ( TestConfigOAuth . BlobServiceEndpoint ) . ToHttp ( ) ;
82
+ Uri httpUri = new Uri ( Tenants . TestConfigOAuth . BlobServiceEndpoint ) . ToHttp ( ) ;
82
83
83
84
// Act
84
85
TestHelper . AssertExpectedException (
85
- ( ) => new AppendBlobClient ( httpUri , GetOAuthCredential ( ) ) ,
86
+ ( ) => new AppendBlobClient ( httpUri , Tenants . GetOAuthCredential ( ) ) ,
86
87
new ArgumentException ( "Cannot use TokenCredential without HTTPS." ) ) ;
87
88
}
88
89
@@ -431,7 +432,7 @@ public async Task CreateAsync_EncryptionScopeAccountSAS()
431
432
// Arrange
432
433
string containerName = GetNewContainerName ( ) ;
433
434
await using DisposingContainer test = await GetTestContainerAsync ( containerName : containerName ) ;
434
- BlobServiceClient blobServiceClient = GetServiceClient_SharedKey ( ) ;
435
+ BlobServiceClient blobServiceClient = BlobsClientBuilder . GetServiceClient_SharedKey ( ) ;
435
436
436
437
AccountSasBuilder accountSasBuilder = new AccountSasBuilder (
437
438
permissions : AccountSasPermissions . All ,
@@ -457,7 +458,7 @@ public async Task CreateAsync_EncryptionScopeAccountSAS()
457
458
public async Task CreateAsync_EncryptionScopeIdentitySAS ( )
458
459
{
459
460
// Arrange
460
- BlobServiceClient oauthService = GetServiceClient_OauthAccount ( ) ;
461
+ BlobServiceClient oauthService = BlobsClientBuilder . GetServiceClient_OAuth ( ) ;
461
462
await using DisposingContainer test = await GetTestContainerAsync ( oauthService ) ;
462
463
463
464
Response < UserDelegationKey > userDelegationKey = await oauthService . GetUserDelegationKeyAsync (
@@ -478,7 +479,7 @@ public async Task CreateAsync_EncryptionScopeIdentitySAS()
478
479
BlobUriBuilder blobUriBuilder = new BlobUriBuilder ( test . Container . Uri )
479
480
{
480
481
BlobName = blobName ,
481
- Sas = blobSasBuilder . ToSasQueryParameters ( userDelegationKey . Value , TestConfigOAuth . AccountName )
482
+ Sas = blobSasBuilder . ToSasQueryParameters ( userDelegationKey . Value , Tenants . TestConfigOAuth . AccountName )
482
483
} ;
483
484
AppendBlobClient sasBlob = InstrumentClient ( new AppendBlobClient ( blobUriBuilder . ToUri ( ) , GetOptions ( ) ) ) ;
484
485
@@ -502,7 +503,7 @@ public async Task CreateAsync_Headers()
502
503
public async Task CreateAsync_Error ( )
503
504
{
504
505
// Arrange
505
- BlobServiceClient blobService = GetServiceClient_SharedKey ( ) ;
506
+ BlobServiceClient blobService = BlobsClientBuilder . GetServiceClient_SharedKey ( ) ;
506
507
BlobContainerClient containerClient = InstrumentClient ( blobService . GetBlobContainerClient ( GetNewContainerName ( ) ) ) ;
507
508
AppendBlobClient blob = InstrumentClient ( containerClient . GetAppendBlobClient ( GetNewBlobName ( ) ) ) ;
508
509
@@ -688,7 +689,7 @@ public async Task CreateIfNotExistsAsync_Exists()
688
689
public async Task CreateIfNotExistsAsync_Error ( )
689
690
{
690
691
// Arrange
691
- BlobServiceClient serviceClient = GetServiceClient_SharedKey ( ) ;
692
+ BlobServiceClient serviceClient = BlobsClientBuilder . GetServiceClient_SharedKey ( ) ;
692
693
BlobContainerClient containerClient = InstrumentClient ( serviceClient . GetBlobContainerClient ( GetNewContainerName ( ) ) ) ;
693
694
AppendBlobClient blob = InstrumentClient ( containerClient . GetAppendBlobClient ( GetNewBlobName ( ) ) ) ;
694
695
@@ -1588,7 +1589,7 @@ await destBlob.AppendBlockFromUriAsync(
1588
1589
public async Task AppendBlockFromUriAsync_SourceBearerToken ( )
1589
1590
{
1590
1591
// Arrange
1591
- BlobServiceClient serviceClient = GetServiceClient_OauthAccount ( ) ;
1592
+ BlobServiceClient serviceClient = BlobsClientBuilder . GetServiceClient_OAuth ( ) ;
1592
1593
await using DisposingContainer test = await GetTestContainerAsync (
1593
1594
service : serviceClient ,
1594
1595
publicAccessType : PublicAccessType . None ) ;
@@ -1623,7 +1624,7 @@ public async Task AppendBlockFromUriAsync_SourceBearerToken()
1623
1624
public async Task AppendBlockFromUriAsync_SourceBearerTokenFail ( )
1624
1625
{
1625
1626
// Arrange
1626
- BlobServiceClient serviceClient = GetServiceClient_OauthAccount ( ) ;
1627
+ BlobServiceClient serviceClient = BlobsClientBuilder . GetServiceClient_OAuth ( ) ;
1627
1628
await using DisposingContainer test = await GetTestContainerAsync (
1628
1629
service : serviceClient ,
1629
1630
publicAccessType : PublicAccessType . None ) ;
@@ -2006,7 +2007,7 @@ public async Task OpenWriteAsync_AlternatingWriteAndFlush()
2006
2007
public async Task OpenWriteAsync_Error ( )
2007
2008
{
2008
2009
// Arrange
2009
- BlobServiceClient service = GetServiceClient_SharedKey ( ) ;
2010
+ BlobServiceClient service = BlobsClientBuilder . GetServiceClient_SharedKey ( ) ;
2010
2011
BlobContainerClient container = InstrumentClient ( service . GetBlobContainerClient ( GetNewContainerName ( ) ) ) ;
2011
2012
AppendBlobClient blob = InstrumentClient ( container . GetAppendBlobClient ( GetNewBlobName ( ) ) ) ;
2012
2013
@@ -2248,9 +2249,9 @@ public void CanMockClientConstructors()
2248
2249
var mock = new Mock < AppendBlobClient > ( TestConfigDefault . ConnectionString , "name" , "name" , new BlobClientOptions ( ) ) . Object ;
2249
2250
mock = new Mock < AppendBlobClient > ( TestConfigDefault . ConnectionString , "name" , "name" ) . Object ;
2250
2251
mock = new Mock < AppendBlobClient > ( new Uri ( "https://test/test" ) , new BlobClientOptions ( ) ) . Object ;
2251
- mock = new Mock < AppendBlobClient > ( new Uri ( "https://test/test" ) , GetNewSharedKeyCredentials ( ) , new BlobClientOptions ( ) ) . Object ;
2252
+ mock = new Mock < AppendBlobClient > ( new Uri ( "https://test/test" ) , Tenants . GetNewSharedKeyCredentials ( ) , new BlobClientOptions ( ) ) . Object ;
2252
2253
mock = new Mock < AppendBlobClient > ( new Uri ( "https://test/test" ) , new AzureSasCredential ( "foo" ) , new BlobClientOptions ( ) ) . Object ;
2253
- mock = new Mock < AppendBlobClient > ( new Uri ( "https://test/test" ) , GetOAuthCredential ( TestConfigHierarchicalNamespace ) , new BlobClientOptions ( ) ) . Object ;
2254
+ mock = new Mock < AppendBlobClient > ( new Uri ( "https://test/test" ) , Tenants . GetOAuthCredential ( Tenants . TestConfigHierarchicalNamespace ) , new BlobClientOptions ( ) ) . Object ;
2254
2255
}
2255
2256
2256
2257
private AppendBlobRequestConditions BuildDestinationAccessConditions (
0 commit comments