Пример #1
0
 public async void CloudBlobRefreshClient_ExecuteAsync_WrongKey_ThrowsStorageException(string wrongCs, string rightCs)
 {
     var refreshKey           = BuildRefreshKeyMock(wrongCs, wrongCs);
     var blobClientMaintainer = new BlobClientMaintainer(refreshKey, 0);
     var refreshClient        = new CloudBlobRefreshClient(blobClientMaintainer);
     await Assert.ThrowsAsync <StorageException>(() => refreshClient.ExecuteAsync(x => x.ListContainersSegmentedAsync(null)));
 }
Пример #2
0
        public async void CloudBlobRefreshClient_ExecuteAsync_Parallel_Success(string wrongCs, string rightCs)
        {
            var refreshKey           = BuildRefreshKeyMock(wrongCs, rightCs);
            var blobClientMaintainer = new BlobClientMaintainer(refreshKey, 0);
            var refreshClient        = new CloudBlobRefreshClient(blobClientMaintainer);
            var tasks = new List <Task <ContainerResultSegment> >();

            for (int i = 0; i < 10; i++)
            {
                tasks.Add(refreshClient.ExecuteAsync(x => x.ListContainersSegmentedAsync(null)));
            }

            var results = await Task.WhenAll(tasks).ConfigureAwait(false);
        }