1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-26 01:37:07 +00:00

Added test for SeriesStatistics

This commit is contained in:
Mark McDowall 2013-04-20 13:13:57 -07:00
parent f86cb87ced
commit cc11e3760a
2 changed files with 47 additions and 0 deletions

View file

@ -170,6 +170,7 @@
<Compile Include="ProviderTests\DiskProviderTests\ExtractArchiveFixture.cs" />
<Compile Include="ProviderTests\PostDownloadProviderTests\DropFolderImportServiceFixture.cs" />
<Compile Include="JobTests\TestJobs.cs" />
<Compile Include="TvTests\SeriesRepositoryTests\SeriesStatisticsFixture.cs" />
<Compile Include="UpdateTests\UpdateServiceFixture.cs" />
<Compile Include="ProviderTests\XemCommunicationProviderTests\GetSceneTvdbMappingsFixture.cs" />
<Compile Include="ProviderTests\XemCommunicationProviderTests\GetXemSeriesIdsFixture.cs" />

View file

@ -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<SeriesRepository, Series>
{
private Episode _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;
_episode = Builder<Episode>.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);
}
}
}