2013-04-17 05:46:07 +03:00
|
|
|
using System;
|
|
|
|
using FizzWare.NBuilder;
|
|
|
|
using FluentAssertions;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
using NzbDrone.Core.Tv;
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Test.TvTests.EpisodeRepositoryTests
|
|
|
|
{
|
|
|
|
[TestFixture]
|
|
|
|
public class EpisodesBetweenDatesFixture : DbTest<EpisodeRepository, Episode>
|
|
|
|
{
|
|
|
|
[SetUp]
|
|
|
|
public void Setup()
|
|
|
|
{
|
|
|
|
var series = Builder<Series>.CreateNew()
|
|
|
|
.With(s => s.Id = 0)
|
|
|
|
.With(s => s.Runtime = 30)
|
2013-07-16 01:52:00 +03:00
|
|
|
.With(s => s.Monitored = true)
|
2013-04-17 05:46:07 +03:00
|
|
|
.Build();
|
|
|
|
|
|
|
|
series.Id = Db.Insert(series).Id;
|
|
|
|
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
.With(e => e.Id = 0)
|
|
|
|
.With(e => e.SeriesId = series.Id)
|
2013-07-16 01:52:00 +03:00
|
|
|
.With(e => e.Monitored = true)
|
2013-04-17 05:46:07 +03:00
|
|
|
.Build();
|
|
|
|
|
|
|
|
Db.Insert(episode);
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
2013-04-18 02:47:41 +03:00
|
|
|
public void should_get_episodes()
|
2013-04-17 05:46:07 +03:00
|
|
|
{
|
|
|
|
var episodes = Subject.EpisodesBetweenDates(DateTime.Today.AddDays(-1), DateTime.Today.AddDays(3));
|
|
|
|
episodes.Should().HaveCount(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|