Sonarr/NzbDrone.Core.Test/TvTests/EpisodeRepositoryTests/EpisodesWithoutFilesFixture.cs

65 lines
2.5 KiB
C#
Raw Normal View History

using FizzWare.NBuilder;
2013-04-20 17:28:17 +00:00
using FluentAssertions;
using NUnit.Framework;
2013-05-02 05:50:34 +00:00
using NzbDrone.Core.Datastore;
2013-04-20 17:28:17 +00:00
using NzbDrone.Core.Test.Framework;
using NzbDrone.Core.Tv;
namespace NzbDrone.Core.Test.TvTests.EpisodeRepositoryTests
{
[TestFixture]
public class EpisodesWithoutFilesFixture : DbTest<EpisodeRepository, Episode>
{
[SetUp]
public void Setup()
{
var series = Builder<Series>.CreateNew()
.With(s => s.Id = 0)
.With(s => s.Runtime = 30)
.Build();
series.Id = Db.Insert(series).Id;
var episodes = Builder<Episode>.CreateListOfSize(2)
.All()
.With(e => e.Id = 0)
.With(e => e.SeriesId = series.Id)
.With(e => e.EpisodeFileId = 0)
.TheLast(1)
.With(e => e.SeasonNumber = 0)
.Build();
Db.InsertMany(episodes);
}
[Test]
public void should_get_episodes()
{
2013-05-02 05:50:34 +00:00
var episodes =
Subject.EpisodesWithoutFiles(new PagingSpec<Episode>
{
Page = 1,
PageSize = 10,
SortKey = "AirDate",
SortDirection = SortDirection.Ascending
2013-05-02 05:50:34 +00:00
}, false);
episodes.Records.Should().HaveCount(1);
2013-04-20 17:28:17 +00:00
}
[Test]
2013-05-02 05:50:34 +00:00
[Ignore("Specials not implemented")]
2013-04-20 17:28:17 +00:00
public void should_get_episode_including_specials()
{
2013-05-02 05:50:34 +00:00
var episodes =
Subject.EpisodesWithoutFiles(new PagingSpec<Episode>
{
Page = 1,
PageSize = 10,
SortKey = "AirDate",
SortDirection = SortDirection.Ascending
2013-05-02 05:50:34 +00:00
}, true);
episodes.Records.Should().HaveCount(2);
2013-04-20 17:28:17 +00:00
}
}
}