mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-27 10:07:10 +00:00
66 lines
2.6 KiB
C#
66 lines
2.6 KiB
C#
using FizzWare.NBuilder;
|
|
using FluentAssertions;
|
|
using NUnit.Framework;
|
|
using NzbDrone.Core.Datastore;
|
|
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)
|
|
.With(s => s.Monitored = true)
|
|
.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)
|
|
.With(e => e.Monitored = true)
|
|
.TheLast(1)
|
|
.With(e => e.SeasonNumber = 0)
|
|
.Build();
|
|
|
|
Db.InsertMany(episodes);
|
|
}
|
|
|
|
[Test]
|
|
public void should_get_episodes()
|
|
{
|
|
var episodes =
|
|
Subject.EpisodesWithoutFiles(new PagingSpec<Episode>
|
|
{
|
|
Page = 1,
|
|
PageSize = 10,
|
|
SortKey = "AirDate",
|
|
SortDirection = SortDirection.Ascending
|
|
}, false);
|
|
episodes.Records.Should().HaveCount(1);
|
|
}
|
|
|
|
[Test]
|
|
[Ignore("Specials not implemented")]
|
|
public void should_get_episode_including_specials()
|
|
{
|
|
var episodes =
|
|
Subject.EpisodesWithoutFiles(new PagingSpec<Episode>
|
|
{
|
|
Page = 1,
|
|
PageSize = 10,
|
|
SortKey = "AirDate",
|
|
SortDirection = SortDirection.Ascending
|
|
}, true);
|
|
episodes.Records.Should().HaveCount(2);
|
|
}
|
|
}
|
|
}
|