Exemplo n.º 1
0
        public async Task CanDownloadFilesAsync() {
            QDownloader = GetQueueDownloader();

            await QDownloader.DownloadAsync(GetDefaultSpec());

            VerifyAsyncDownloads();
        }
Exemplo n.º 2
0
        public async Task CanDownloadFilesAsync()
        {
            QDownloader = GetQueueDownloader();

            await QDownloader.DownloadAsync(GetDefaultSpec());

            VerifyAsyncDownloads();
        }
Exemplo n.º 3
0
        public void CanCancelDownloadFilesAsync() {
            var token = new CancellationTokenSource();
            QDownloader = GetQueueDownloader();
            token.Cancel();

            Func<Task> act = () => QDownloader.DownloadAsync(GetDefaultSpec(), token.Token);

            act.ShouldThrow<OperationCanceledException>();
            token.Dispose();
        }
Exemplo n.º 4
0
        public void CanCancelDownloadFilesAsync()
        {
            var token = new CancellationTokenSource();

            QDownloader = GetQueueDownloader();
            token.Cancel();

            Func <Task> act = () => QDownloader.DownloadAsync(GetDefaultSpec(), token.Token);

            act.ShouldThrow <OperationCanceledException>();
            token.Dispose();
        }