1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-23 22:25:14 -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
@@ -20,22 +20,18 @@ namespace NzbDrone.Core.Test.Download.Pending.PendingReleaseServiceTests
public class AddFixture : CoreTest<PendingReleaseService>
{
private DownloadDecision _temporarilyRejected;
private Series _series;
private Episode _episode;
private Movie _movie;
private Profile _profile;
private ReleaseInfo _release;
private ParsedEpisodeInfo _parsedEpisodeInfo;
private RemoteEpisode _remoteEpisode;
private ParsedMovieInfo _parsedMovieInfo;
private RemoteMovie _remoteMovie;
[SetUp]
public void Setup()
{
_series = Builder<Series>.CreateNew()
_movie = Builder<Movie>.CreateNew()
.Build();
_episode = Builder<Episode>.CreateNew()
.Build();
_profile = new Profile
{
Name = "Test",
@@ -48,32 +44,27 @@ namespace NzbDrone.Core.Test.Download.Pending.PendingReleaseServiceTests
},
};
_series.Profile = new LazyLoaded<Profile>(_profile);
_movie.Profile = new LazyLoaded<Profile>(_profile);
_release = Builder<ReleaseInfo>.CreateNew().Build();
_parsedEpisodeInfo = Builder<ParsedEpisodeInfo>.CreateNew().Build();
_parsedEpisodeInfo.Quality = new QualityModel(Quality.HDTV720p);
_parsedMovieInfo = Builder<ParsedMovieInfo>.CreateNew().Build();
_parsedMovieInfo.Quality = new QualityModel(Quality.HDTV720p);
_remoteEpisode = new RemoteEpisode();
_remoteEpisode.Episodes = new List<Episode>{ _episode };
_remoteEpisode.Series = _series;
_remoteEpisode.ParsedEpisodeInfo = _parsedEpisodeInfo;
_remoteEpisode.Release = _release;
_remoteMovie = new RemoteMovie();
_remoteMovie.Movie = _movie;
_remoteMovie.ParsedMovieInfo = _parsedMovieInfo;
_remoteMovie.Release = _release;
_temporarilyRejected = new DownloadDecision(_remoteEpisode, new Rejection("Temp Rejected", RejectionType.Temporary));
_temporarilyRejected = new DownloadDecision(_remoteMovie, new Rejection("Temp Rejected", RejectionType.Temporary));
Mocker.GetMock<IPendingReleaseRepository>()
.Setup(s => s.All())
.Returns(new List<PendingRelease>());
Mocker.GetMock<ISeriesService>()
.Setup(s => s.GetSeries(It.IsAny<int>()))
.Returns(_series);
Mocker.GetMock<IParsingService>()
.Setup(s => s.GetEpisodes(It.IsAny<ParsedEpisodeInfo>(), _series, true, null))
.Returns(new List<Episode> {_episode});
Mocker.GetMock<IMovieService>()
.Setup(s => s.GetMovie(It.IsAny<int>()))
.Returns(_movie);
Mocker.GetMock<IPrioritizeDownloadDecision>()
.Setup(s => s.PrioritizeDecisions(It.IsAny<List<DownloadDecision>>()))
@@ -89,7 +80,7 @@ namespace NzbDrone.Core.Test.Download.Pending.PendingReleaseServiceTests
var heldReleases = Builder<PendingRelease>.CreateListOfSize(1)
.All()
.With(h => h.SeriesId = _series.Id)
.With(h => h.MovieId = _movie.Id)
.With(h => h.Title = title)
.With(h => h.Release = release)
.Build();