mirror of
https://github.com/lidarr/Lidarr
synced 2025-02-20 21:16:56 +00:00
Fixed broken FailedDownloadService tests
This commit is contained in:
parent
7c6fad155a
commit
7b6549fcd3
2 changed files with 17 additions and 1 deletions
|
@ -82,7 +82,6 @@ public void Download_report_should_not_publish_on_failed_grab_event()
|
||||||
VerifyEventNotPublished<EpisodeGrabbedEvent>();
|
VerifyEventNotPublished<EpisodeGrabbedEvent>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void should_not_attempt_download_if_client_isnt_configure()
|
public void should_not_attempt_download_if_client_isnt_configure()
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
using FizzWare.NBuilder;
|
using FizzWare.NBuilder;
|
||||||
using Moq;
|
using Moq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
using NzbDrone.Core.Configuration;
|
||||||
using NzbDrone.Core.Download;
|
using NzbDrone.Core.Download;
|
||||||
using NzbDrone.Core.History;
|
using NzbDrone.Core.History;
|
||||||
using NzbDrone.Core.Messaging.Events;
|
using NzbDrone.Core.Messaging.Events;
|
||||||
|
@ -34,6 +35,10 @@ public void Setup()
|
||||||
|
|
||||||
Mocker.GetMock<IProvideDownloadClient>()
|
Mocker.GetMock<IProvideDownloadClient>()
|
||||||
.Setup(c => c.GetDownloadClient()).Returns(Mocker.GetMock<IDownloadClient>().Object);
|
.Setup(c => c.GetDownloadClient()).Returns(Mocker.GetMock<IDownloadClient>().Object);
|
||||||
|
|
||||||
|
Mocker.GetMock<IConfigService>()
|
||||||
|
.SetupGet(s => s.EnableFailedDownloadHandling)
|
||||||
|
.Returns(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GivenNoGrabbedHistory()
|
private void GivenNoGrabbedHistory()
|
||||||
|
@ -188,5 +193,17 @@ public void should_have_multiple_episode_ids_when_multi_episode_release_fails()
|
||||||
|
|
||||||
VerifyFailedDownloads(2);
|
VerifyFailedDownloads(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void should_skip_if_enable_failed_download_handling_is_off()
|
||||||
|
{
|
||||||
|
Mocker.GetMock<IConfigService>()
|
||||||
|
.SetupGet(s => s.EnableFailedDownloadHandling)
|
||||||
|
.Returns(false);
|
||||||
|
|
||||||
|
Subject.Execute(new FailedDownloadCommand());
|
||||||
|
|
||||||
|
VerifyNoFailedDownloads();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue