diff --git a/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj b/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj index e2ddef8d9..d7250b0f5 100644 --- a/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj +++ b/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj @@ -170,6 +170,7 @@ + diff --git a/NzbDrone.Core.Test/TvTests/SeriesRepositoryTests/SeriesStatisticsFixture.cs b/NzbDrone.Core.Test/TvTests/SeriesRepositoryTests/SeriesStatisticsFixture.cs new file mode 100644 index 000000000..f0418b75c --- /dev/null +++ b/NzbDrone.Core.Test/TvTests/SeriesRepositoryTests/SeriesStatisticsFixture.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using FizzWare.NBuilder; +using FluentAssertions; +using NUnit.Framework; +using NzbDrone.Core.Test.Framework; +using NzbDrone.Core.Tv; + +namespace NzbDrone.Core.Test.TvTests.SeriesRepositoryTests +{ + [TestFixture] + public class SeriesStatisticsFixture : DbTest + { + private Episode _episode; + + [SetUp] + public void Setup() + { + var series = Builder.CreateNew() + .With(s => s.Id = 0) + .With(s => s.Runtime = 30) + .Build(); + + series.Id = Db.Insert(series).Id; + + _episode = Builder.CreateNew() + .With(e => e.Id = 0) + .With(e => e.SeriesId = series.Id) + .With(e => e.AirDate = DateTime.Today.AddDays(5)) + .Build(); + + Db.Insert(_episode); + } + + [Test] + public void should_get_episodes() + { + var stats = Subject.SeriesStatistics(); + + stats.Should().HaveCount(1); + stats.First().NextAiring.Should().Be(_episode.AirDate); + } + } +}