mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-22 22:14:44 -04:00
New: Series Overview sorted by Next Airing now sorts all remaining items by their Last Aired date.
This commit is contained in:
@@ -39,6 +39,11 @@ namespace NzbDrone.Core.Test.SeriesStatsTests
|
||||
_episode.EpisodeFileId = 1;
|
||||
}
|
||||
|
||||
private void GivenOldEpisode()
|
||||
{
|
||||
_episode.AirDateUtc = DateTime.Now.AddSeconds(-10);
|
||||
}
|
||||
|
||||
private void GivenMonitoredEpisode()
|
||||
{
|
||||
_episode.Monitored = true;
|
||||
@@ -59,6 +64,7 @@ namespace NzbDrone.Core.Test.SeriesStatsTests
|
||||
|
||||
stats.Should().HaveCount(1);
|
||||
stats.First().NextAiring.Should().Be(_episode.AirDateUtc);
|
||||
stats.First().PreviousAiring.Should().NotHaveValue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -73,6 +79,47 @@ namespace NzbDrone.Core.Test.SeriesStatsTests
|
||||
stats.First().NextAiring.Should().NotHaveValue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_have_previous_airing_for_old_episode_with_file()
|
||||
{
|
||||
GivenEpisodeWithFile();
|
||||
GivenOldEpisode();
|
||||
GivenFile();
|
||||
|
||||
var stats = Subject.SeriesStatistics();
|
||||
|
||||
stats.Should().HaveCount(1);
|
||||
stats.First().NextAiring.Should().NotHaveValue();
|
||||
stats.First().PreviousAiring.Should().Be(_episode.AirDateUtc);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_have_previous_airing_for_old_episode_without_file_monitored()
|
||||
{
|
||||
GivenMonitoredEpisode();
|
||||
GivenOldEpisode();
|
||||
GivenFile();
|
||||
|
||||
var stats = Subject.SeriesStatistics();
|
||||
|
||||
stats.Should().HaveCount(1);
|
||||
stats.First().NextAiring.Should().NotHaveValue();
|
||||
stats.First().PreviousAiring.Should().Be(_episode.AirDateUtc);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_not_have_previous_airing_for_old_episode_without_file_unmonitored()
|
||||
{
|
||||
GivenOldEpisode();
|
||||
GivenFile();
|
||||
|
||||
var stats = Subject.SeriesStatistics();
|
||||
|
||||
stats.Should().HaveCount(1);
|
||||
stats.First().NextAiring.Should().NotHaveValue();
|
||||
stats.First().PreviousAiring.Should().NotHaveValue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_not_include_unmonitored_episode_in_episode_count()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user