@@ -18,7 +18,7 @@ public class MultipartTests : TestBase
18
18
[ MultipleProviders ( S3Provider . GoogleCloudStorage , SseAlgorithm . Aes256 ) ]
19
19
public async Task MultipartWithEncryption ( S3Provider provider , string bucket , ISimpleClient client , SseAlgorithm algorithm )
20
20
{
21
- string objectKey = nameof ( MultipartWithEncryption ) ;
21
+ const string objectKey = nameof ( MultipartWithEncryption ) ;
22
22
23
23
CreateMultipartUploadResponse createResp = await client . CreateMultipartUploadAsync ( bucket , objectKey , req => req . SseAlgorithm = algorithm ) ;
24
24
Assert . Equal ( 200 , createResp . StatusCode ) ;
@@ -54,9 +54,9 @@ public async Task MultipartWithEncryption(S3Provider provider, string bucket, IS
54
54
[ MultipleProviders ( S3Provider . AmazonS3 ) ]
55
55
public async Task MultipartCustomerEncryption ( S3Provider _ , string bucket , ISimpleClient client )
56
56
{
57
- string objectKey = nameof ( MultipartCustomerEncryption ) ;
57
+ const string objectKey = nameof ( MultipartCustomerEncryption ) ;
58
58
59
- byte [ ] key = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 } ;
59
+ byte [ ] key = [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ] ;
60
60
byte [ ] keyMd5 = CryptoHelper . Md5Hash ( key ) ;
61
61
62
62
CreateMultipartUploadResponse initResp = await client . CreateMultipartUploadAsync ( bucket , objectKey , r =>
@@ -79,7 +79,7 @@ public async Task MultipartCustomerEncryption(S3Provider _, string bucket, ISimp
79
79
Assert . Equal ( SseCustomerAlgorithm . Aes256 , uploadResp1 . SseCustomerAlgorithm ) ;
80
80
Assert . Equal ( keyMd5 , uploadResp1 . SseCustomerKeyMd5 ) ;
81
81
82
- CompleteMultipartUploadResponse completeResp = await client . CompleteMultipartUploadAsync ( bucket , objectKey , initResp . UploadId , new [ ] { new S3PartInfo ( uploadResp1 . ETag , 1 ) } ) ;
82
+ CompleteMultipartUploadResponse completeResp = await client . CompleteMultipartUploadAsync ( bucket , objectKey , initResp . UploadId , [ new S3PartInfo ( uploadResp1 . ETag , 1 ) ] ) ;
83
83
Assert . Equal ( 200 , completeResp . StatusCode ) ;
84
84
Assert . Equal ( SseCustomerAlgorithm . Aes256 , completeResp . SseCustomerAlgorithm ) ;
85
85
}
@@ -88,7 +88,7 @@ public async Task MultipartCustomerEncryption(S3Provider _, string bucket, ISimp
88
88
[ MultipleProviders ( S3Provider . AmazonS3 | S3Provider . GoogleCloudStorage ) ]
89
89
public async Task MultipartLockMode ( S3Provider _ , string bucket , ISimpleClient client )
90
90
{
91
- string objectKey = nameof ( MultipartLockMode ) ;
91
+ const string objectKey = nameof ( MultipartLockMode ) ;
92
92
93
93
CreateMultipartUploadResponse initResp = await client . CreateMultipartUploadAsync ( bucket , objectKey , r =>
94
94
{
@@ -103,15 +103,15 @@ public async Task MultipartLockMode(S3Provider _, string bucket, ISimpleClient c
103
103
UploadPartResponse uploadResp = await client . UploadPartAsync ( bucket , objectKey , 1 , initResp . UploadId , ms , r => r . ContentMd5 = CryptoHelper . Md5Hash ( file ) ) ;
104
104
Assert . Equal ( 200 , uploadResp . StatusCode ) ;
105
105
106
- CompleteMultipartUploadResponse completeResp = await client . CompleteMultipartUploadAsync ( bucket , objectKey , initResp . UploadId , new [ ] { new S3PartInfo ( uploadResp . ETag , 1 ) } ) ;
106
+ CompleteMultipartUploadResponse completeResp = await client . CompleteMultipartUploadAsync ( bucket , objectKey , initResp . UploadId , [ new S3PartInfo ( uploadResp . ETag , 1 ) ] ) ;
107
107
Assert . Equal ( 200 , completeResp . StatusCode ) ;
108
108
}
109
109
110
110
[ Theory ]
111
111
[ MultipleProviders ( S3Provider . AmazonS3 | S3Provider . GoogleCloudStorage ) ]
112
112
public async Task MultipartSinglePart ( S3Provider provider , string bucket , ISimpleClient client )
113
113
{
114
- string objectKey = nameof ( MultipartSinglePart ) ;
114
+ const string objectKey = nameof ( MultipartSinglePart ) ;
115
115
116
116
CreateMultipartUploadResponse createResp = await client . CreateMultipartUploadAsync ( bucket , objectKey ) ;
117
117
Assert . Equal ( 200 , createResp . StatusCode ) ;
@@ -135,7 +135,7 @@ public async Task MultipartSinglePart(S3Provider provider, string bucket, ISimpl
135
135
Assert . Equal ( 200 , uploadResp . StatusCode ) ;
136
136
Assert . Equal ( "\" 10f74ef02085310ccd1f87150b83e537\" " , uploadResp . ETag ) ;
137
137
138
- CompleteMultipartUploadResponse completeResp = await client . CompleteMultipartUploadAsync ( bucket , objectKey , createResp . UploadId , new [ ] { new S3PartInfo ( uploadResp . ETag , 1 ) } ) ;
138
+ CompleteMultipartUploadResponse completeResp = await client . CompleteMultipartUploadAsync ( bucket , objectKey , createResp . UploadId , [ new S3PartInfo ( uploadResp . ETag , 1 ) ] ) ;
139
139
Assert . Equal ( 200 , completeResp . StatusCode ) ;
140
140
Assert . Equal ( "\" bd74e21dfa8678d127240f76e518e9c2-1\" " , completeResp . ETag ) ;
141
141
@@ -151,7 +151,7 @@ public async Task MultipartSinglePart(S3Provider provider, string bucket, ISimpl
151
151
[ MultipleProviders ( S3Provider . All ) ]
152
152
public async Task MultipartTooSmall ( S3Provider provider , string bucket , ISimpleClient client )
153
153
{
154
- string objectKey = nameof ( MultipartTooSmall ) ;
154
+ const string objectKey = nameof ( MultipartTooSmall ) ;
155
155
156
156
CreateMultipartUploadResponse initResp = await client . CreateMultipartUploadAsync ( bucket , objectKey ) ;
157
157
Assert . Equal ( 200 , initResp . StatusCode ) ;
@@ -172,15 +172,15 @@ public async Task MultipartTooSmall(S3Provider provider, string bucket, ISimpleC
172
172
UploadPartResponse uploadResp2 = await client . UploadPartAsync ( bucket , objectKey , 2 , initResp . UploadId , ms2 ) ;
173
173
Assert . Equal ( 200 , uploadResp2 . StatusCode ) ;
174
174
175
- CompleteMultipartUploadResponse completeResp = await client . CompleteMultipartUploadAsync ( bucket , objectKey , initResp . UploadId , new [ ] { new S3PartInfo ( uploadResp1 . ETag , 1 ) , new S3PartInfo ( uploadResp2 . ETag , 2 ) } ) ;
175
+ CompleteMultipartUploadResponse completeResp = await client . CompleteMultipartUploadAsync ( bucket , objectKey , initResp . UploadId , [ new S3PartInfo ( uploadResp1 . ETag , 1 ) , new S3PartInfo ( uploadResp2 . ETag , 2 ) ] ) ;
176
176
Assert . Equal ( 400 , completeResp . StatusCode ) ;
177
177
}
178
178
179
179
[ Theory ]
180
180
[ MultipleProviders ( S3Provider . AmazonS3 | S3Provider . GoogleCloudStorage ) ]
181
181
public async Task MultipartUpload ( S3Provider provider , string bucket , ISimpleClient client )
182
182
{
183
- string objectKey = nameof ( MultipartUpload ) ;
183
+ const string objectKey = nameof ( MultipartUpload ) ;
184
184
185
185
CreateMultipartUploadResponse initResp = await client . CreateMultipartUploadAsync ( bucket , objectKey ) ;
186
186
Assert . Equal ( 200 , initResp . StatusCode ) ;
@@ -204,7 +204,7 @@ public async Task MultipartUpload(S3Provider provider, string bucket, ISimpleCli
204
204
Assert . Equal ( 200 , uploadResp2 . StatusCode ) ;
205
205
Assert . NotNull ( uploadResp2 . ETag ) ;
206
206
207
- CompleteMultipartUploadResponse completeResp = await client . CompleteMultipartUploadAsync ( bucket , objectKey , initResp . UploadId , new [ ] { new S3PartInfo ( uploadResp1 . ETag , 1 ) , new S3PartInfo ( uploadResp2 . ETag , 2 ) } ) ;
207
+ CompleteMultipartUploadResponse completeResp = await client . CompleteMultipartUploadAsync ( bucket , objectKey , initResp . UploadId , [ new S3PartInfo ( uploadResp1 . ETag , 1 ) , new S3PartInfo ( uploadResp2 . ETag , 2 ) ] ) ;
208
208
Assert . Equal ( 200 , completeResp . StatusCode ) ;
209
209
Assert . NotNull ( uploadResp2 . ETag ) ;
210
210
0 commit comments