2011-10-24 05:54:09 +00:00
|
|
|
|
using System;
|
2011-05-22 16:53:06 +00:00
|
|
|
|
using FizzWare.NBuilder;
|
2011-06-23 06:56:17 +00:00
|
|
|
|
using FluentAssertions;
|
2011-06-02 21:06:46 +00:00
|
|
|
|
using NUnit.Framework;
|
2013-03-01 07:03:41 +00:00
|
|
|
|
using NzbDrone.Core.MediaFiles;
|
2013-02-19 06:01:03 +00:00
|
|
|
|
using NzbDrone.Core.Tv;
|
2011-05-22 16:53:06 +00:00
|
|
|
|
using NzbDrone.Core.Model;
|
2013-03-07 01:51:47 +00:00
|
|
|
|
|
2011-05-22 16:53:06 +00:00
|
|
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Test
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
2013-05-13 00:36:23 +00:00
|
|
|
|
|
2013-02-17 05:44:06 +00:00
|
|
|
|
public class EpisodeStatusTest : CoreTest
|
2013-02-24 20:24:31 +00:00
|
|
|
|
{
|
2013-04-15 01:41:39 +00:00
|
|
|
|
[TestCase(1, true, true, EpisodeStatuses.Ready)]
|
|
|
|
|
public void ignored_episode(int offsetDays, bool ignored, bool hasEpisodes, EpisodeStatuses status)
|
2011-05-22 16:53:06 +00:00
|
|
|
|
{
|
|
|
|
|
Episode episode = Builder<Episode>.CreateNew()
|
|
|
|
|
.With(e => e.AirDate = DateTime.Now.AddDays(offsetDays))
|
|
|
|
|
.With(e => e.Ignored = ignored)
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
if (hasEpisodes)
|
|
|
|
|
{
|
2013-02-20 02:05:15 +00:00
|
|
|
|
episode.EpisodeFile = new EpisodeFile();
|
2011-05-22 16:53:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-02-24 20:24:31 +00:00
|
|
|
|
episode.Status.Should().Be(status);
|
|
|
|
|
|
2011-05-22 16:53:06 +00:00
|
|
|
|
}
|
2011-05-22 17:29:10 +00:00
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void low_air_date()
|
|
|
|
|
{
|
|
|
|
|
Episode episode = Builder<Episode>.CreateNew()
|
2011-06-23 06:56:17 +00:00
|
|
|
|
.With(e => e.AirDate = DateTime.Now.AddDays(20))
|
2011-05-22 17:29:10 +00:00
|
|
|
|
.With(e => e.Ignored = false)
|
2013-05-13 00:36:23 +00:00
|
|
|
|
.With(e => e.EpisodeFileId = 0)
|
2011-05-22 17:29:10 +00:00
|
|
|
|
.Build();
|
|
|
|
|
|
2011-06-02 01:16:17 +00:00
|
|
|
|
|
2013-04-15 01:41:39 +00:00
|
|
|
|
episode.Status.Should().Be(EpisodeStatuses.NotAired);
|
2011-05-22 17:29:10 +00:00
|
|
|
|
}
|
2011-05-22 16:53:06 +00:00
|
|
|
|
}
|
|
|
|
|
}
|