1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-31 03:11:07 +02:00

Fixed failing tests in DownloadStation.

This commit is contained in:
Taloth Saldono 2017-12-19 22:49:27 +01:00
parent 96108cb758
commit 15bd181f16
4 changed files with 6 additions and 0 deletions

View File

@ -610,6 +610,7 @@ public void GetItems_should_return_canBeMoved_and_canBeDeleted_as_expected(Downl
[TestCase(DownloadStationTaskStatus.Seeding, DownloadItemStatus.Completed)]
[TestCase(DownloadStationTaskStatus.FilehostingWaiting, DownloadItemStatus.Queued)]
[TestCase(DownloadStationTaskStatus.Waiting, DownloadItemStatus.Queued)]
[TestCase(DownloadStationTaskStatus.Unknown, DownloadItemStatus.Queued)]
public void GetItems_should_return_item_as_downloadItemStatus(DownloadStationTaskStatus apiStatus, DownloadItemStatus expectedItemStatus)
{
GivenSerialNumber();

View File

@ -419,6 +419,7 @@ public void GetItems_should_map_outputpath_for_completed_or_failed_tasks()
[TestCase(DownloadStationTaskStatus.Seeding, DownloadItemStatus.Completed)]
[TestCase(DownloadStationTaskStatus.FilehostingWaiting, DownloadItemStatus.Queued)]
[TestCase(DownloadStationTaskStatus.Waiting, DownloadItemStatus.Queued)]
[TestCase(DownloadStationTaskStatus.Unknown, DownloadItemStatus.Queued)]
public void GetItems_should_return_item_as_downloadItemStatus(DownloadStationTaskStatus apiStatus, DownloadItemStatus expectedItemStatus)
{
GivenSerialNumber();

View File

@ -227,7 +227,9 @@ protected DownloadItemStatus GetStatus(DownloadStationTask torrent)
{
switch (torrent.Status)
{
case DownloadStationTaskStatus.Unknown:
case DownloadStationTaskStatus.Waiting:
case DownloadStationTaskStatus.FilehostingWaiting:
return torrent.Size == 0 || GetRemainingSize(torrent) > 0 ? DownloadItemStatus.Queued : DownloadItemStatus.Completed;
case DownloadStationTaskStatus.Paused:
return DownloadItemStatus.Paused;

View File

@ -315,7 +315,9 @@ protected DownloadItemStatus GetStatus(DownloadStationTask task)
{
switch (task.Status)
{
case DownloadStationTaskStatus.Unknown:
case DownloadStationTaskStatus.Waiting:
case DownloadStationTaskStatus.FilehostingWaiting:
return task.Size == 0 || GetRemainingSize(task) > 0 ? DownloadItemStatus.Queued : DownloadItemStatus.Completed;
case DownloadStationTaskStatus.Paused:
return DownloadItemStatus.Paused;