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

Fixed all tests and even added some new ones :) (#835)

* First fixing of tests.

* Updated more tests.

* Fix some tests

* Fix all prioritization tests.

And add new for preferred words.

* Updated CompletedDownloadservice tests

* Fixed a lot of tests

* Fixed all indexer requests. We should add more for the indexers we added.

To lazy for that though ¯\_(ツ)_/¯

* Fixed organizer tests.

Should probably be also updated to incorporate our newly added tags.

* Fix notification tests.

* Fixed update test for osx

* Fixed a few more tests.

* Fixed some more tests.

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update activity.less

* Update appveyor.yml

* Update appveyor.yml

* Update CommonVersionInfo.cs

* Update build-appveyor.cake

Let's hope this works.

* Update CommonVersionInfo.cs

Just to kickstart appveyor

* Fixed a few tests

* Just ignore those tests.

* Fixed more tests.

* First steps in fixing Core.Test.Download.DownloadApprovedFixture

* Fix most DownloadApprovedFixture tests

* Fixed something.

* Fixed a few more tests.

* Fixed pending release tests.

* All Core tests are now fixed.

* Fixed the last tests :)

* Fixed Download Station Tests.

* Fixed Vuze and Transmission default settings which caused the tests to fail.

* Fix most tests.

* Fix RootFolder tests.

* Fixed last tests
This commit is contained in:
Leonardo Galli
2017-03-06 22:23:25 +01:00
committed by GitHub
parent 5bd008f468
commit 7cfa0531dc
74 changed files with 801 additions and 1094 deletions
@@ -21,7 +21,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests
private string _pneumaticFolder;
private string _sabDrop;
private string _nzbPath;
private RemoteEpisode _remoteEpisode;
private RemoteMovie _remoteMovie;
[SetUp]
public void Setup()
@@ -33,13 +33,13 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests
Mocker.GetMock<IConfigService>().SetupGet(c => c.DownloadedEpisodesFolder).Returns(_sabDrop);
_remoteEpisode = new RemoteEpisode();
_remoteEpisode.Release = new ReleaseInfo();
_remoteEpisode.Release.Title = _title;
_remoteEpisode.Release.DownloadUrl = _nzbUrl;
_remoteMovie = new RemoteMovie();
_remoteMovie.Release = new ReleaseInfo();
_remoteMovie.Release.Title = _title;
_remoteMovie.Release.DownloadUrl = _nzbUrl;
_remoteEpisode.ParsedEpisodeInfo = new ParsedEpisodeInfo();
_remoteEpisode.ParsedEpisodeInfo.FullSeason = false;
_remoteMovie.ParsedEpisodeInfo = new ParsedEpisodeInfo();
_remoteMovie.ParsedEpisodeInfo.FullSeason = false;
Subject.Definition = new DownloadClientDefinition();
Subject.Definition.Settings = new PneumaticSettings
@@ -56,7 +56,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests
[Test]
public void should_download_file_if_it_doesnt_exist()
{
Subject.Download(_remoteEpisode);
Subject.Download(_remoteMovie);
Mocker.GetMock<IHttpClient>().Verify(c => c.DownloadFile(_nzbUrl, _nzbPath), Times.Once());
}
@@ -67,16 +67,16 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests
{
WithFailedDownload();
Assert.Throws<WebException>(() => Subject.Download(_remoteEpisode));
Assert.Throws<WebException>(() => Subject.Download(_remoteMovie));
}
[Test]
public void should_throw_if_full_season_download()
{
_remoteEpisode.Release.Title = "30 Rock - Season 1";
_remoteEpisode.ParsedEpisodeInfo.FullSeason = true;
_remoteMovie.Release.Title = "30 Rock - Season 1";
_remoteMovie.ParsedEpisodeInfo.FullSeason = true;
Assert.Throws<NotSupportedException>(() => Subject.Download(_remoteEpisode));
Assert.Throws<NotSupportedException>(() => Subject.Download(_remoteMovie));
}
[Test]
@@ -90,9 +90,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests
{
var illegalTitle = "Saturday Night Live - S38E08 - Jeremy Renner/Maroon 5 [SDTV]";
var expectedFilename = Path.Combine(_pneumaticFolder, "Saturday Night Live - S38E08 - Jeremy Renner+Maroon 5 [SDTV].nzb");
_remoteEpisode.Release.Title = illegalTitle;
_remoteMovie.Release.Title = illegalTitle;
Subject.Download(_remoteEpisode);
Subject.Download(_remoteMovie);
Mocker.GetMock<IHttpClient>().Verify(c => c.DownloadFile(It.IsAny<string>(), expectedFilename), Times.Once());
}