cleaned up parsing logic and structure.

This commit is contained in:
kay.one 2013-04-14 18:41:39 -07:00
commit 6e88f55a54
120 changed files with 2149 additions and 3064 deletions

View file

@ -14,11 +14,11 @@ namespace NzbDrone.Core.Test
public class EpisodeStatusTest : CoreTest
{
[TestCase(1, false, false, EpisodeStatusType.NotAired)]
[TestCase(-2, false, false, EpisodeStatusType.Missing)]
[TestCase(0, false, false, EpisodeStatusType.AirsToday)]
[TestCase(1, true, false, EpisodeStatusType.Ready)]
public void no_grab_date(int offsetDays, bool hasEpisodes, bool ignored, EpisodeStatusType status)
[TestCase(1, false, false, EpisodeStatuses.NotAired)]
[TestCase(-2, false, false, EpisodeStatuses.Missing)]
[TestCase(0, false, false, EpisodeStatuses.AirsToday)]
[TestCase(1, true, false, EpisodeStatuses.Ready)]
public void no_grab_date(int offsetDays, bool hasEpisodes, bool ignored, EpisodeStatuses status)
{
Episode episode = Builder<Episode>.CreateNew()
.With(e => e.AirDate = DateTime.Now.AddDays(offsetDays))
@ -34,11 +34,11 @@ namespace NzbDrone.Core.Test
episode.Status.Should().Be(status);
}
[TestCase(1, false, false, EpisodeStatusType.Missing)]
[TestCase(-2, false, false, EpisodeStatusType.Missing)]
[TestCase(1, true, false, EpisodeStatusType.Ready)]
[TestCase(1, false, false, EpisodeStatuses.Missing)]
[TestCase(-2, false, false, EpisodeStatuses.Missing)]
[TestCase(1, true, false, EpisodeStatuses.Ready)]
public void old_grab_date(int offsetDays, bool hasEpisodes, bool ignored,
EpisodeStatusType status)
EpisodeStatuses status)
{
Episode episode = Builder<Episode>.CreateNew()
.With(e => e.Ignored = ignored)
@ -54,13 +54,13 @@ namespace NzbDrone.Core.Test
episode.Status.Should().Be(status);
}
[TestCase(1, false, false, EpisodeStatusType.Downloading)]
[TestCase(-2, false, false, EpisodeStatusType.Downloading)]
[TestCase(1, true, false, EpisodeStatusType.Ready)]
[TestCase(1, true, true, EpisodeStatusType.Ready)]
[TestCase(1, false, true, EpisodeStatusType.Downloading)]
[TestCase(1, false, false, EpisodeStatuses.Downloading)]
[TestCase(-2, false, false, EpisodeStatuses.Downloading)]
[TestCase(1, true, false, EpisodeStatuses.Ready)]
[TestCase(1, true, true, EpisodeStatuses.Ready)]
[TestCase(1, false, true, EpisodeStatuses.Downloading)]
public void recent_grab_date(int offsetDays, bool hasEpisodes, bool ignored,
EpisodeStatusType status)
EpisodeStatuses status)
{
Episode episode = Builder<Episode>.CreateNew()
.With(e => e.AirDate = DateTime.Now.AddDays(offsetDays))
@ -77,8 +77,8 @@ namespace NzbDrone.Core.Test
}
[TestCase(1, true, true, EpisodeStatusType.Ready)]
public void ignored_episode(int offsetDays, bool ignored, bool hasEpisodes, EpisodeStatusType status)
[TestCase(1, true, true, EpisodeStatuses.Ready)]
public void ignored_episode(int offsetDays, bool ignored, bool hasEpisodes, EpisodeStatuses status)
{
Episode episode = Builder<Episode>.CreateNew()
.With(e => e.AirDate = DateTime.Now.AddDays(offsetDays))
@ -105,15 +105,15 @@ namespace NzbDrone.Core.Test
.Build();
episode.Status.Should().Be(EpisodeStatusType.NotAired);
episode.Status.Should().Be(EpisodeStatuses.NotAired);
}
[TestCase(false, false, EpisodeStatusType.Failed, PostDownloadStatusType.Failed)]
[TestCase(false, false, EpisodeStatusType.Unpacking, PostDownloadStatusType.Unpacking)]
[TestCase(true, false, EpisodeStatusType.Ready, PostDownloadStatusType.Failed)]
[TestCase(true, true, EpisodeStatusType.Ready, PostDownloadStatusType.Unpacking)]
[TestCase(false, false, EpisodeStatuses.Failed, PostDownloadStatusType.Failed)]
[TestCase(false, false, EpisodeStatuses.Unpacking, PostDownloadStatusType.Unpacking)]
[TestCase(true, false, EpisodeStatuses.Ready, PostDownloadStatusType.Failed)]
[TestCase(true, true, EpisodeStatuses.Ready, PostDownloadStatusType.Unpacking)]
public void episode_downloaded_post_download_status_is_used(bool hasEpisodes, bool ignored,
EpisodeStatusType status, PostDownloadStatusType postDownloadStatus)
EpisodeStatuses status, PostDownloadStatusType postDownloadStatus)
{
Episode episode = Builder<Episode>.CreateNew()
.With(e => e.Ignored = ignored)