mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-26 20:11:49 +02:00
Fixed broken tests.
Added new Episode status test for AirsToday.
This commit is contained in:
@@ -14,7 +14,9 @@ namespace NzbDrone.Core.Test
|
|||||||
{
|
{
|
||||||
[TestCase(1, false, false, EpisodeStatusType.NotAired)]
|
[TestCase(1, false, false, EpisodeStatusType.NotAired)]
|
||||||
[TestCase(-2, false, false, EpisodeStatusType.Missing)]
|
[TestCase(-2, false, false, EpisodeStatusType.Missing)]
|
||||||
|
[TestCase(0, false, false, EpisodeStatusType.AirsToday)]
|
||||||
[TestCase(1, true, false, EpisodeStatusType.Ready)]
|
[TestCase(1, true, false, EpisodeStatusType.Ready)]
|
||||||
|
[TestCase(0, true, false, EpisodeStatusType.Ready)]
|
||||||
public void no_grab_date(int offsetDays, bool hasEpisodes, bool ignored, EpisodeStatusType status)
|
public void no_grab_date(int offsetDays, bool hasEpisodes, bool ignored, EpisodeStatusType status)
|
||||||
{
|
{
|
||||||
Episode episode = Builder<Episode>.CreateNew()
|
Episode episode = Builder<Episode>.CreateNew()
|
||||||
@@ -41,7 +43,8 @@ namespace NzbDrone.Core.Test
|
|||||||
Episode episode = Builder<Episode>.CreateNew()
|
Episode episode = Builder<Episode>.CreateNew()
|
||||||
.With(e => e.Ignored = ignored)
|
.With(e => e.Ignored = ignored)
|
||||||
.With(e => e.EpisodeFileId = 0)
|
.With(e => e.EpisodeFileId = 0)
|
||||||
.With(e => e.GrabDate = DateTime.Now.AddDays(-1).AddHours(-1))
|
.With(e => e.GrabDate = DateTime.Now.AddDays(-2).AddHours(-1))
|
||||||
|
.With(e => e.AirDate = DateTime.Today.AddDays(-2))
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
if (hasEpisodes)
|
if (hasEpisodes)
|
||||||
@@ -49,7 +52,7 @@ namespace NzbDrone.Core.Test
|
|||||||
episode.EpisodeFileId = 12;
|
episode.EpisodeFileId = 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
Assert.AreEqual(status, episode.Status);
|
episode.Status.Should().Be(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestCase(1, false, false, EpisodeStatusType.Downloading)]
|
[TestCase(1, false, false, EpisodeStatusType.Downloading)]
|
||||||
|
Reference in New Issue
Block a user