mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-22 22:16:13 -04:00
Tests for repack fix and improve behaviour when release group is unknown
This commit is contained in:
@@ -84,7 +84,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_false_if_is_a_repack_for_existing_file()
|
||||
public void should_return_false_if_is_a_repack_for_a_different_file()
|
||||
{
|
||||
_parsedEpisodeInfo.Quality.Revision.IsRepack = true;
|
||||
_episodes.First().EpisodeFileId = 1;
|
||||
@@ -102,5 +102,47 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
.Should()
|
||||
.BeFalse();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_false_if_release_group_for_existing_file_is_unknown()
|
||||
{
|
||||
_parsedEpisodeInfo.Quality.Revision.IsRepack = true;
|
||||
_episodes.First().EpisodeFileId = 1;
|
||||
_episodes.First().EpisodeFile = Builder<EpisodeFile>.CreateNew()
|
||||
.With(e => e.ReleaseGroup = "")
|
||||
.Build();
|
||||
|
||||
var remoteEpisode = Builder<RemoteEpisode>.CreateNew()
|
||||
.With(e => e.ParsedEpisodeInfo = _parsedEpisodeInfo)
|
||||
.With(e => e.Episodes = _episodes)
|
||||
.Build();
|
||||
|
||||
Subject.IsSatisfiedBy(remoteEpisode, null)
|
||||
.Accepted
|
||||
.Should()
|
||||
.BeFalse();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_false_if_release_group_for_release_is_unknown()
|
||||
{
|
||||
_parsedEpisodeInfo.Quality.Revision.IsRepack = true;
|
||||
_parsedEpisodeInfo.ReleaseGroup = null;
|
||||
|
||||
_episodes.First().EpisodeFileId = 1;
|
||||
_episodes.First().EpisodeFile = Builder<EpisodeFile>.CreateNew()
|
||||
.With(e => e.ReleaseGroup = "Sonarr")
|
||||
.Build();
|
||||
|
||||
var remoteEpisode = Builder<RemoteEpisode>.CreateNew()
|
||||
.With(e => e.ParsedEpisodeInfo = _parsedEpisodeInfo)
|
||||
.With(e => e.Episodes = _episodes)
|
||||
.Build();
|
||||
|
||||
Subject.IsSatisfiedBy(remoteEpisode, null)
|
||||
.Accepted
|
||||
.Should()
|
||||
.BeFalse();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user