@@ -52,8 +52,7 @@ public async Task WillCreateABlobContainerForDemandedFoldersIfTheyDoNotExist(str
5252 {
5353 var fakeBlobClient = new Mock < ICloudBlobClient > ( ) ;
5454 var fakeBlobContainer = new Mock < ICloudBlobContainer > ( ) ;
55- fakeBlobContainer . Setup ( x => x . CreateIfNotExistAsync ( ) ) . Returns ( Task . FromResult ( 0 ) ) . Verifiable ( ) ;
56- fakeBlobContainer . Setup ( x => x . SetPermissionsAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
55+ fakeBlobContainer . Setup ( x => x . CreateIfNotExistAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) . Verifiable ( ) ;
5756 var simpleCloudBlob = new Mock < ISimpleCloudBlob > ( ) ;
5857 simpleCloudBlob . Setup ( x => x . DownloadToStreamAsync ( It . IsAny < Stream > ( ) , It . IsAny < AccessCondition > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
5958 fakeBlobContainer . Setup ( x => x . GetBlobReference ( "x.txt" ) ) . Returns ( simpleCloudBlob . Object ) ;
@@ -72,14 +71,11 @@ public async Task WillCreateABlobContainerForDemandedFoldersIfTheyDoNotExist(str
7271 public async Task WillSetPermissionsForDemandedFolderInBlobContainers ( string folderName , bool isPublic )
7372 {
7473 var fakeBlobContainer = new Mock < ICloudBlobContainer > ( ) ;
75- fakeBlobContainer . Setup ( x => x . SetPermissionsAsync ( It . IsAny < BlobContainerPermissions > ( ) ) )
76- . Returns ( Task . FromResult ( 0 ) )
77- . Verifiable ( ) ;
78-
74+
7975 var simpleCloudBlob = new Mock < ISimpleCloudBlob > ( ) ;
8076 simpleCloudBlob . Setup ( x => x . DownloadToStreamAsync ( It . IsAny < Stream > ( ) , It . IsAny < AccessCondition > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
8177
82- fakeBlobContainer . Setup ( x => x . CreateIfNotExistAsync ( ) ) . Returns ( Task . FromResult ( 0 ) ) ;
78+ fakeBlobContainer . Setup ( x => x . CreateIfNotExistAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) . Verifiable ( ) ;
8379 fakeBlobContainer . Setup ( x => x . GetBlobReference ( "x.txt" ) ) . Returns ( simpleCloudBlob . Object ) ;
8480
8581 var fakeBlobClient = new Mock < ICloudBlobClient > ( ) ;
@@ -115,8 +111,7 @@ public async Task WillGetTheBlobFromTheCorrectFolderContainer(string folderName)
115111 {
116112 blobContainer = new Mock < ICloudBlobContainer > ( ) ;
117113 }
118- blobContainer . Setup ( x => x . CreateIfNotExistAsync ( ) ) . Returns ( Task . FromResult ( 0 ) ) ;
119- blobContainer . Setup ( x => x . SetPermissionsAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
114+ blobContainer . Setup ( x => x . CreateIfNotExistAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
120115 return blobContainer . Object ;
121116 } ) ;
122117 fakeBlobContainer . Setup ( x => x . GetBlobReference ( It . IsAny < string > ( ) ) ) . Returns ( fakeBlob . Object ) ;
@@ -139,8 +134,7 @@ public async Task WillDeleteTheBlobIfItExists()
139134 fakeBlob . Setup ( x => x . DeleteIfExistsAsync ( ) ) . Returns ( Task . FromResult ( 0 ) ) . Verifiable ( ) ;
140135 fakeBlobClient . Setup ( x => x . GetContainerReference ( It . IsAny < string > ( ) ) ) . Returns ( fakeBlobContainer . Object ) ;
141136 fakeBlobContainer . Setup ( x => x . GetBlobReference ( It . IsAny < string > ( ) ) ) . Returns ( fakeBlob . Object ) ;
142- fakeBlobContainer . Setup ( x => x . CreateIfNotExistAsync ( ) ) . Returns ( Task . FromResult ( 0 ) ) ;
143- fakeBlobContainer . Setup ( x => x . SetPermissionsAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
137+ fakeBlobContainer . Setup ( x => x . CreateIfNotExistAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
144138 fakeBlob . Setup ( x => x . Uri ) . Returns ( new Uri ( "http://theUri" ) ) ;
145139 var service = CreateService ( fakeBlobClient : fakeBlobClient ) ;
146140
@@ -206,8 +200,7 @@ public async Task WillDownloadTheFile(string folderName)
206200 containerMock = new Mock < ICloudBlobContainer > ( ) ;
207201 }
208202
209- containerMock . Setup ( x => x . CreateIfNotExistAsync ( ) ) . Returns ( Task . FromResult ( 0 ) ) ;
210- containerMock . Setup ( x => x . SetPermissionsAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
203+ containerMock . Setup ( x => x . CreateIfNotExistAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
211204 return containerMock . Object ;
212205 } ) ;
213206 fakeBlobContainer . Setup ( x => x . GetBlobReference ( It . IsAny < string > ( ) ) ) . Returns ( fakeBlob . Object ) ;
@@ -241,8 +234,7 @@ public async Task WillReturnTheStreamWhenTheFileExists(string folderName)
241234 {
242235 blobContainer = new Mock < ICloudBlobContainer > ( ) ;
243236 }
244- blobContainer . Setup ( x => x . CreateIfNotExistAsync ( ) ) . Returns ( Task . FromResult ( 0 ) ) ;
245- blobContainer . Setup ( x => x . SetPermissionsAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
237+ blobContainer . Setup ( x => x . CreateIfNotExistAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
246238 return blobContainer . Object ;
247239 } ) ;
248240 fakeBlobContainer . Setup ( x => x . GetBlobReference ( It . IsAny < string > ( ) ) ) . Returns ( fakeBlob . Object ) ;
@@ -277,8 +269,7 @@ public async Task WillReturnNullIfFileDoesNotExist(string folderName)
277269 {
278270 blobContainer = new Mock < ICloudBlobContainer > ( ) ;
279271 }
280- blobContainer . Setup ( x => x . CreateIfNotExistAsync ( ) ) . Returns ( Task . FromResult ( 0 ) ) ;
281- blobContainer . Setup ( x => x . SetPermissionsAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
272+ blobContainer . Setup ( x => x . CreateIfNotExistAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
282273 return blobContainer . Object ;
283274 } ) ;
284275 fakeBlobContainer . Setup ( x => x . GetBlobReference ( It . IsAny < string > ( ) ) ) . Returns ( fakeBlob . Object ) ;
@@ -312,8 +303,7 @@ public async Task WillSetTheStreamPositionToZero(string folderName)
312303 {
313304 blobContainer = new Mock < ICloudBlobContainer > ( ) ;
314305 }
315- blobContainer . Setup ( x => x . CreateIfNotExistAsync ( ) ) . Returns ( Task . FromResult ( 0 ) ) ;
316- blobContainer . Setup ( x => x . SetPermissionsAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
306+ blobContainer . Setup ( x => x . CreateIfNotExistAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
317307 return blobContainer . Object ;
318308 } ) ;
319309 fakeBlobContainer . Setup ( x => x . GetBlobReference ( It . IsAny < string > ( ) ) ) . Returns ( fakeBlob . Object ) ;
@@ -350,8 +340,7 @@ public async Task WillGetTheBlobFromTheCorrectFolderContainer(string folderName,
350340 {
351341 blobContainer = new Mock < ICloudBlobContainer > ( ) ;
352342 }
353- blobContainer . Setup ( x => x . CreateIfNotExistAsync ( ) ) . Returns ( Task . FromResult ( 0 ) ) ;
354- blobContainer . Setup ( x => x . SetPermissionsAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
343+ blobContainer . Setup ( x => x . CreateIfNotExistAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
355344 return blobContainer . Object ;
356345 } ) ;
357346 fakeBlobContainer . Setup ( x => x . GetBlobReference ( It . IsAny < string > ( ) ) ) . Returns ( fakeBlob . Object ) ;
@@ -378,8 +367,7 @@ public async Task WillDeleteBlobIfItExistsAndOverwriteTrue()
378367 fakeBlob . Setup ( x => x . SetPropertiesAsync ( ) ) . Returns ( Task . FromResult ( 0 ) ) . Verifiable ( ) ;
379368 fakeBlobClient . Setup ( x => x . GetContainerReference ( It . IsAny < string > ( ) ) ) . Returns ( fakeBlobContainer . Object ) ;
380369 fakeBlobContainer . Setup ( x => x . GetBlobReference ( It . IsAny < string > ( ) ) ) . Returns ( fakeBlob . Object ) ;
381- fakeBlobContainer . Setup ( x => x . SetPermissionsAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
382- fakeBlobContainer . Setup ( x => x . CreateIfNotExistAsync ( ) ) . Returns ( Task . FromResult ( 0 ) ) ;
370+ fakeBlobContainer . Setup ( x => x . CreateIfNotExistAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
383371 fakeBlob . Setup ( x => x . Properties ) . Returns ( new BlobProperties ( ) ) ;
384372 fakeBlob . Setup ( x => x . Uri ) . Returns ( new Uri ( "http://theUri" ) ) ;
385373 var service = CreateService ( fakeBlobClient : fakeBlobClient ) ;
@@ -403,8 +391,7 @@ public async Task WillThrowIfBlobExistsAndOverwriteFalse()
403391 new Exception ( "inner" ) ) ) ;
404392 fakeBlobClient . Setup ( x => x . GetContainerReference ( It . IsAny < string > ( ) ) ) . Returns ( fakeBlobContainer . Object ) ;
405393 fakeBlobContainer . Setup ( x => x . GetBlobReference ( It . IsAny < string > ( ) ) ) . Returns ( fakeBlob . Object ) ;
406- fakeBlobContainer . Setup ( x => x . SetPermissionsAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
407- fakeBlobContainer . Setup ( x => x . CreateIfNotExistAsync ( ) ) . Returns ( Task . FromResult ( 0 ) ) ;
394+ fakeBlobContainer . Setup ( x => x . CreateIfNotExistAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
408395 fakeBlob . Setup ( x => x . Properties ) . Returns ( new BlobProperties ( ) ) ;
409396 fakeBlob . Setup ( x => x . Uri ) . Returns ( new Uri ( "http://theUri" ) ) ;
410397 var service = CreateService ( fakeBlobClient : fakeBlobClient ) ;
@@ -419,8 +406,7 @@ public async Task WillUploadThePackageFileToTheBlob()
419406 {
420407 var fakeBlobClient = new Mock < ICloudBlobClient > ( ) ;
421408 var fakeBlobContainer = new Mock < ICloudBlobContainer > ( ) ;
422- fakeBlobContainer . Setup ( x => x . CreateIfNotExistAsync ( ) ) . Returns ( Task . FromResult ( 0 ) ) ;
423- fakeBlobContainer . Setup ( x => x . SetPermissionsAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
409+ fakeBlobContainer . Setup ( x => x . CreateIfNotExistAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
424410 var fakeBlob = new Mock < ISimpleCloudBlob > ( ) ;
425411 fakeBlobClient . Setup ( x => x . GetContainerReference ( It . IsAny < string > ( ) ) ) . Returns ( fakeBlobContainer . Object ) ;
426412 fakeBlobContainer . Setup ( x => x . GetBlobReference ( It . IsAny < string > ( ) ) ) . Returns ( fakeBlob . Object ) ;
@@ -457,8 +443,7 @@ public async Task WillSetTheBlobContentType(string folderName)
457443 {
458444 blobContainer = new Mock < ICloudBlobContainer > ( ) ;
459445 }
460- blobContainer . Setup ( x => x . CreateIfNotExistAsync ( ) ) . Returns ( Task . FromResult ( 0 ) ) ;
461- blobContainer . Setup ( x => x . SetPermissionsAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
446+ blobContainer . Setup ( x => x . CreateIfNotExistAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
462447 return blobContainer . Object ;
463448 } ) ;
464449 fakeBlobContainer . Setup ( x => x . GetBlobReference ( It . IsAny < string > ( ) ) ) . Returns ( fakeBlob . Object ) ;
@@ -488,8 +473,7 @@ public async Task WillSetTheBlobControlCacheOnPackagesFolder(string folderName)
488473 {
489474 var fakeBlobClient = new Mock < ICloudBlobClient > ( ) ;
490475 var fakeBlobContainer = new Mock < ICloudBlobContainer > ( ) ;
491- fakeBlobContainer . Setup ( x => x . CreateIfNotExistAsync ( ) ) . Returns ( Task . FromResult ( 0 ) ) ;
492- fakeBlobContainer . Setup ( x => x . SetPermissionsAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
476+ fakeBlobContainer . Setup ( x => x . CreateIfNotExistAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
493477 var fakeBlob = new Mock < ISimpleCloudBlob > ( ) ;
494478 fakeBlobClient . Setup ( x => x . GetContainerReference ( It . IsAny < string > ( ) ) ) . Returns ( fakeBlobContainer . Object ) ;
495479 fakeBlobContainer . Setup ( x => x . GetBlobReference ( It . IsAny < string > ( ) ) ) . Returns ( fakeBlob . Object ) ;
@@ -543,8 +527,7 @@ public async Task WillGetTheBlobFromTheCorrectFolderContainer(string folderName,
543527 {
544528 blobContainer = new Mock < ICloudBlobContainer > ( ) ;
545529 }
546- blobContainer . Setup ( x => x . CreateIfNotExistAsync ( ) ) . Returns ( Task . FromResult ( 0 ) ) ;
547- blobContainer . Setup ( x => x . SetPermissionsAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
530+ blobContainer . Setup ( x => x . CreateIfNotExistAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
548531 return blobContainer . Object ;
549532 } ) ;
550533 fakeBlobContainer . Setup ( x => x . GetBlobReference ( It . IsAny < string > ( ) ) ) . Returns ( fakeBlob . Object ) ;
@@ -665,8 +648,7 @@ public async Task WillSetTheBlobContentType(string folderName)
665648 {
666649 blobContainer = new Mock < ICloudBlobContainer > ( ) ;
667650 }
668- blobContainer . Setup ( x => x . CreateIfNotExistAsync ( ) ) . Returns ( Task . FromResult ( 0 ) ) ;
669- blobContainer . Setup ( x => x . SetPermissionsAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
651+ blobContainer . Setup ( x => x . CreateIfNotExistAsync ( It . IsAny < BlobContainerPermissions > ( ) ) ) . Returns ( Task . FromResult ( 0 ) ) ;
670652 return blobContainer . Object ;
671653 } ) ;
672654 fakeBlobContainer . Setup ( x => x . GetBlobReference ( It . IsAny < string > ( ) ) ) . Returns ( fakeBlob . Object ) ;
@@ -1375,9 +1357,7 @@ public TheSetMetadataAsyncMethod()
13751357
13761358 _blobClient . Setup ( x => x . GetContainerReference ( It . IsAny < string > ( ) ) )
13771359 . Returns ( _blobContainer . Object ) ;
1378- _blobContainer . Setup ( x => x . CreateIfNotExistAsync ( ) )
1379- . Returns ( Task . FromResult ( 0 ) ) ;
1380- _blobContainer . Setup ( x => x . SetPermissionsAsync ( It . IsAny < BlobContainerPermissions > ( ) ) )
1360+ _blobContainer . Setup ( x => x . CreateIfNotExistAsync ( It . IsAny < BlobContainerPermissions > ( ) ) )
13811361 . Returns ( Task . FromResult ( 0 ) ) ;
13821362 _blobContainer . Setup ( x => x . GetBlobReference ( It . IsAny < string > ( ) ) )
13831363 . Returns ( _blob . Object ) ;
@@ -1479,9 +1459,7 @@ public TheSetPropertiesAsyncMethod()
14791459
14801460 _blobClient . Setup ( x => x . GetContainerReference ( It . IsAny < string > ( ) ) )
14811461 . Returns ( _blobContainer . Object ) ;
1482- _blobContainer . Setup ( x => x . CreateIfNotExistAsync ( ) )
1483- . Returns ( Task . FromResult ( 0 ) ) ;
1484- _blobContainer . Setup ( x => x . SetPermissionsAsync ( It . IsAny < BlobContainerPermissions > ( ) ) )
1462+ _blobContainer . Setup ( x => x . CreateIfNotExistAsync ( It . IsAny < BlobContainerPermissions > ( ) ) )
14851463 . Returns ( Task . FromResult ( 0 ) ) ;
14861464 _blobContainer . Setup ( x => x . GetBlobReference ( It . IsAny < string > ( ) ) )
14871465 . Returns ( _blob . Object ) ;
@@ -1583,9 +1561,7 @@ public TheGetETagMethod()
15831561
15841562 _blobClient . Setup ( x => x . GetContainerReference ( It . IsAny < string > ( ) ) )
15851563 . Returns ( _blobContainer . Object ) ;
1586- _blobContainer . Setup ( x => x . CreateIfNotExistAsync ( ) )
1587- . Returns ( Task . FromResult ( 0 ) ) ;
1588- _blobContainer . Setup ( x => x . SetPermissionsAsync ( It . IsAny < BlobContainerPermissions > ( ) ) )
1564+ _blobContainer . Setup ( x => x . CreateIfNotExistAsync ( It . IsAny < BlobContainerPermissions > ( ) ) )
15891565 . Returns ( Task . FromResult ( 0 ) ) ;
15901566 _blobContainer . Setup ( x => x . GetBlobReference ( It . IsAny < string > ( ) ) )
15911567 . Returns ( _blob . Object ) ;
0 commit comments