1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-26 22:46:53 -04:00

New: Async HttpClient

(cherry picked from commit e12111cee885e23a42308f299ef773e5ae021712)
This commit is contained in:
Bogdan
2023-07-16 21:07:31 +03:00
parent d61ce6112b
commit efe5c3beb7
56 changed files with 653 additions and 527 deletions
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using FluentAssertions;
using Moq;
using NUnit.Framework;
@@ -55,26 +56,26 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.TransmissionTests
}
[Test]
public void Download_should_return_unique_id()
public async Task Download_should_return_unique_id()
{
GivenSuccessfulDownload();
var remoteMovie = CreateRemoteMovie();
var id = Subject.Download(remoteMovie, CreateIndexer());
var id = await Subject.Download(remoteMovie, CreateIndexer());
id.Should().NotBeNullOrEmpty();
}
[Test]
public void Download_with_MovieDirectory_should_force_directory()
public async Task Download_with_MovieDirectory_should_force_directory()
{
GivenMovieDirectory();
GivenSuccessfulDownload();
var remoteMovie = CreateRemoteMovie();
var id = Subject.Download(remoteMovie, CreateIndexer());
var id = await Subject.Download(remoteMovie, CreateIndexer());
id.Should().NotBeNullOrEmpty();
@@ -83,14 +84,14 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.TransmissionTests
}
[Test]
public void Download_with_category_should_force_directory()
public async Task Download_with_category_should_force_directory()
{
GivenMovieCategory();
GivenSuccessfulDownload();
var remoteMovie = CreateRemoteMovie();
var id = Subject.Download(remoteMovie, CreateIndexer());
var id = await Subject.Download(remoteMovie, CreateIndexer());
id.Should().NotBeNullOrEmpty();
@@ -99,7 +100,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.TransmissionTests
}
[Test]
public void Download_with_category_should_not_have_double_slashes()
public async Task Download_with_category_should_not_have_double_slashes()
{
GivenMovieCategory();
GivenSuccessfulDownload();
@@ -108,7 +109,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.TransmissionTests
var remoteMovie = CreateRemoteMovie();
var id = Subject.Download(remoteMovie, CreateIndexer());
var id = await Subject.Download(remoteMovie, CreateIndexer());
id.Should().NotBeNullOrEmpty();
@@ -117,13 +118,13 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.TransmissionTests
}
[Test]
public void Download_without_TvDirectory_and_Category_should_use_default()
public async Task Download_without_TvDirectory_and_Category_should_use_default()
{
GivenSuccessfulDownload();
var remoteMovie = CreateRemoteMovie();
var id = Subject.Download(remoteMovie, CreateIndexer());
var id = await Subject.Download(remoteMovie, CreateIndexer());
id.Should().NotBeNullOrEmpty();
@@ -132,14 +133,14 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.TransmissionTests
}
[TestCase("magnet:?xt=urn:btih:ZPBPA2P6ROZPKRHK44D5OW6NHXU5Z6KR&tr=udp", "CBC2F069FE8BB2F544EAE707D75BCD3DE9DCF951")]
public void Download_should_get_hash_from_magnet_url(string magnetUrl, string expectedHash)
public async Task Download_should_get_hash_from_magnet_url(string magnetUrl, string expectedHash)
{
GivenSuccessfulDownload();
var remoteMovie = CreateRemoteMovie();
remoteMovie.Release.DownloadUrl = magnetUrl;
var id = Subject.Download(remoteMovie, CreateIndexer());
var id = await Subject.Download(remoteMovie, CreateIndexer());
id.Should().Be(expectedHash);
}