1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-14 15:03:42 +01:00
Radarr/NzbDrone.Core.Test/TvTests/EpisodeRepositoryTests/EpisodesWithoutFilesFixture.cs

65 lines
2.5 KiB
C#
Raw Normal View History

using FizzWare.NBuilder;
2013-04-20 19:28:17 +02:00
using FluentAssertions;
using NUnit.Framework;
2013-05-02 07:50:34 +02:00
using NzbDrone.Core.Datastore;
2013-04-20 19:28:17 +02: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 07:50:34 +02:00
var episodes =
Subject.EpisodesWithoutFiles(new PagingSpec<Episode>
{
Page = 1,
PageSize = 10,
SortKey = "AirDate",
SortDirection = SortDirection.Ascending
2013-05-02 07:50:34 +02:00
}, false);
episodes.Records.Should().HaveCount(1);
2013-04-20 19:28:17 +02:00
}
[Test]
2013-05-02 07:50:34 +02:00
[Ignore("Specials not implemented")]
2013-04-20 19:28:17 +02:00
public void should_get_episode_including_specials()
{
2013-05-02 07:50:34 +02:00
var episodes =
Subject.EpisodesWithoutFiles(new PagingSpec<Episode>
{
Page = 1,
PageSize = 10,
SortKey = "AirDate",
SortDirection = SortDirection.Ascending
2013-05-02 07:50:34 +02:00
}, true);
episodes.Records.Should().HaveCount(2);
2013-04-20 19:28:17 +02:00
}
}
}