1- using FluentAssertions ;
2- using Storage . Tests . Mocks ;
1+ using Storage . Tests . Utils ;
32
43namespace Storage . Tests ;
54
6- public sealed class BucketShould : IClassFixture < StorageFixture >
5+ public sealed class BucketShould ( StorageFixture fixture ) : IClassFixture < StorageFixture >
76{
8- private readonly CancellationToken _cancellation ;
9- private readonly StorageFixture _fixture ;
10- private readonly S3Client _client ;
11-
12- public BucketShould ( StorageFixture fixture )
13- {
14- _cancellation = CancellationToken . None ;
15- _client = fixture . S3Client ;
16- _fixture = fixture ;
17- }
7+ private readonly CancellationToken _cancellation = CancellationToken . None ;
8+ private readonly S3Client _client = fixture . S3Client ;
189
1910 [ Fact ]
2011 public async Task CreateBucket ( )
2112 {
22- var settings = _fixture . Settings ;
13+ var settings = fixture . Settings ;
2314
2415 // don't use using here
2516 var client =
2617 new S3Client (
2718 new S3Settings
2819 {
2920 AccessKey = settings . AccessKey ,
30- Bucket = _fixture . Create < string > ( ) ,
21+ Bucket = fixture . Create < string > ( ) ,
3122 EndPoint = settings . EndPoint ,
3223 Port = settings . Port ,
3324 SecretKey = settings . SecretKey ,
3425 UseHttps = settings . UseHttps ,
3526 } ,
36- _fixture . HttpClient ) ;
27+ fixture . HttpClient ) ;
3728
3829 var bucketCreateResult = await client . CreateBucket ( _cancellation ) ;
3930
@@ -55,21 +46,21 @@ public async Task BeExists()
5546 [ Fact ]
5647 public async Task BeNotExists ( )
5748 {
58- var settings = _fixture . Settings ;
49+ var settings = fixture . Settings ;
5950
6051 // don't dispose it
6152 var client =
6253 new S3Client (
6354 new S3Settings
6455 {
6556 AccessKey = settings . AccessKey ,
66- Bucket = _fixture . Create < string > ( ) ,
57+ Bucket = fixture . Create < string > ( ) ,
6758 EndPoint = settings . EndPoint ,
6859 Port = settings . Port ,
6960 SecretKey = settings . SecretKey ,
7061 UseHttps = settings . UseHttps ,
7162 } ,
72- _fixture . HttpClient ) ;
63+ fixture . HttpClient ) ;
7364
7465 var bucketExistsResult = await client . IsBucketExists ( _cancellation ) ;
7566
@@ -88,21 +79,21 @@ public Task NotThrowIfCreateBucketAlreadyExists()
8879 [ Fact ]
8980 public Task NotThrowIfDeleteNotExistsBucket ( )
9081 {
91- var settings = _fixture . Settings ;
82+ var settings = fixture . Settings ;
9283
9384 // don't use using here
9485 var client =
9586 new S3Client (
9687 new S3Settings
9788 {
9889 AccessKey = settings . AccessKey ,
99- Bucket = _fixture . Create < string > ( ) ,
90+ Bucket = fixture . Create < string > ( ) ,
10091 EndPoint = settings . EndPoint ,
10192 Port = settings . Port ,
10293 SecretKey = settings . SecretKey ,
10394 UseHttps = settings . UseHttps ,
10495 } ,
105- _fixture . HttpClient ) ;
96+ fixture . HttpClient ) ;
10697
10798 return client
10899 . Invoking ( c => c . DeleteBucket ( _cancellation ) )
0 commit comments