mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-18 21:35:51 -04:00
Monitored instead of ignored for episodes and seasons
This commit is contained in:
@@ -30,8 +30,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
.With(c => c.Monitored = true)
|
||||
.Build();
|
||||
|
||||
_firstEpisode = new Episode { Ignored = false };
|
||||
_secondEpisode = new Episode { Ignored = false };
|
||||
_firstEpisode = new Episode { Monitored = true };
|
||||
_secondEpisode = new Episode { Monitored = true };
|
||||
|
||||
|
||||
var singleEpisodeList = new List<Episode> { _firstEpisode };
|
||||
@@ -48,20 +48,16 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
Series = _fakeSeries,
|
||||
Episodes = singleEpisodeList
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void WithFirstEpisodeIgnored()
|
||||
private void WithFirstEpisodeUnmonitored()
|
||||
{
|
||||
_firstEpisode.Ignored = true;
|
||||
_firstEpisode.Monitored = false;
|
||||
}
|
||||
|
||||
private void WithSecondEpisodeIgnored()
|
||||
private void WithSecondEpisodeUnmonitored()
|
||||
{
|
||||
_secondEpisode.Ignored = true;
|
||||
_secondEpisode.Monitored = false;
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -81,34 +77,34 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
|
||||
|
||||
[Test]
|
||||
public void only_episode_ignored_should_return_false()
|
||||
public void only_episode_not_monitored_should_return_false()
|
||||
{
|
||||
WithFirstEpisodeIgnored();
|
||||
WithFirstEpisodeUnmonitored();
|
||||
_monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultSingle).Should().BeFalse();
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void both_episodes_ignored_should_return_false()
|
||||
public void both_episodes_not_monitored_should_return_false()
|
||||
{
|
||||
WithFirstEpisodeIgnored();
|
||||
WithSecondEpisodeIgnored();
|
||||
WithFirstEpisodeUnmonitored();
|
||||
WithSecondEpisodeUnmonitored();
|
||||
_monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultMulti).Should().BeFalse();
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void only_first_episode_ignored_should_return_monitored()
|
||||
public void only_first_episode_not_monitored_should_return_monitored()
|
||||
{
|
||||
WithFirstEpisodeIgnored();
|
||||
WithFirstEpisodeUnmonitored();
|
||||
_monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultMulti).Should().BeTrue();
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void only_second_episode_ignored_should_return_monitored()
|
||||
public void only_second_episode_not_monitored_should_return_monitored()
|
||||
{
|
||||
WithSecondEpisodeIgnored();
|
||||
WithSecondEpisodeUnmonitored();
|
||||
_monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultMulti).Should().BeTrue();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/*
|
||||
//TODO: Alrighty then... We should delete this or uncomment some of these tests...
|
||||
|
||||
/*
|
||||
|
||||
|
||||
using System;
|
||||
|
||||
@@ -13,26 +13,25 @@ namespace NzbDrone.Core.Test.TvTests
|
||||
{
|
||||
public class SeasonProviderTest : DbTest<SeasonRepository, Season>
|
||||
{
|
||||
|
||||
[TestCase(true)]
|
||||
[TestCase(false)]
|
||||
public void IsIgnored_should_return_ignored_status_of_season(bool ignoreFlag)
|
||||
public void Ismonitored_should_return_monitored_status_of_season(bool monitored)
|
||||
{
|
||||
var fakeSeason = Builder<Season>.CreateNew()
|
||||
.With(s => s.Ignored = ignoreFlag)
|
||||
.With(s => s.Monitored = monitored)
|
||||
.BuildNew<Season>();
|
||||
|
||||
Db.Insert(fakeSeason);
|
||||
|
||||
var result = Subject.IsIgnored(fakeSeason.SeriesId, fakeSeason.SeasonNumber);
|
||||
var result = Subject.IsMonitored(fakeSeason.SeriesId, fakeSeason.SeasonNumber);
|
||||
|
||||
result.Should().Be(ignoreFlag);
|
||||
result.Should().Be(monitored);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void IsIgnored_should_return_false_if_not_in_db()
|
||||
public void Monitored_should_return_true_if_not_in_db()
|
||||
{
|
||||
Subject.IsIgnored(10, 0).Should().BeFalse();
|
||||
Subject.IsMonitored(10, 0).Should().BeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
Reference in New Issue
Block a user