예제 #1
0
 private void SetupDownload(Mock <BlobBaseClient> blockClient, MockDataSource dataSource)
 {
     blockClient.SetupGet(c => c.UsingClientSideEncryption).Returns(false);
     blockClient.Setup(c => c.DownloadStreamingInternal(
                           It.IsAny <HttpRange>(),
                           It.IsAny <BlobRequestConditions>(),
                           false,
                           It.IsAny <IProgress <long> >(),
                           $"{nameof(BlobBaseClient)}.{nameof(BlobBaseClient.DownloadStreaming)}",
                           _async,
                           s_cancellationToken)
                       ).Returns <HttpRange, BlobRequestConditions, bool, IProgress <long>, string, bool, CancellationToken>(
         (range, conditions, rangeGetHash, progress, operationName, async, cancellation) =>
     {
         return(async
                 ? dataSource.GetStreamAsync(
                    range,
                    conditions,
                    rangeGetHash,
                    progress: progress,
                    cancellation)
                 : Task.FromResult(dataSource.GetStream(
                                       range,
                                       conditions,
                                       rangeGetHash,
                                       progress: progress,
                                       cancellation)));
     });
 }
 private void SetupDownload(Mock <BlobBaseClient> blockClient, MockDataSource dataSource)
 {
     if (_async)
     {
         blockClient.Setup(c => c.DownloadStreamingAsync(It.IsAny <HttpRange>(), It.IsAny <BlobRequestConditions>(), false, s_cancellationToken))
         .Returns <HttpRange, BlobRequestConditions, bool, CancellationToken>((range, conditions, rangeGetHash, cancellation) =>
                                                                              dataSource.GetStreamAsync(
                                                                                  range,
                                                                                  conditions,
                                                                                  rangeGetHash,
                                                                                  progress: default,
 private void SetupDownload(Mock <BlobBaseClient> blockClient, MockDataSource dataSource)
 {
     if (_async)
     {
         blockClient.Setup(c => c.DownloadStreamingAsync(It.IsAny <HttpRange>(), It.IsAny <BlobRequestConditions>(), false, s_cancellationToken))
         .Returns <HttpRange, BlobRequestConditions, bool, CancellationToken>(dataSource.GetStreamAsync);
         blockClient.Setup(c => c.DownloadStreamingAsync(It.IsAny <BlobDownloadOptions>(), s_cancellationToken))
         .Returns <BlobDownloadOptions, CancellationToken>((options, cancellationToken) => dataSource.GetStreamAsync(
                                                               options.Range,
                                                               options.Conditions,