mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-10-30 15:32:31 +01:00
Attempting join of Series to Episodes
This commit is contained in:
parent
618c81b78f
commit
0ee175e382
@ -154,6 +154,7 @@
|
|||||||
<Compile Include="ProviderTests\RecycleBinProviderTests\DeleteFileFixture.cs" />
|
<Compile Include="ProviderTests\RecycleBinProviderTests\DeleteFileFixture.cs" />
|
||||||
<Compile Include="ProviderTests\RecycleBinProviderTests\DeleteDirectoryFixture.cs" />
|
<Compile Include="ProviderTests\RecycleBinProviderTests\DeleteDirectoryFixture.cs" />
|
||||||
<Compile Include="ProviderTests\PlexProviderTest.cs" />
|
<Compile Include="ProviderTests\PlexProviderTest.cs" />
|
||||||
|
<Compile Include="TvTests\EpisodeRepositoryTests\EpisodesBetweenDatesFixture.cs" />
|
||||||
<Compile Include="TvTests\SeasonProviderTest.cs" />
|
<Compile Include="TvTests\SeasonProviderTest.cs" />
|
||||||
<Compile Include="DecisionEngineTests\RetentionSpecificationFixture.cs" />
|
<Compile Include="DecisionEngineTests\RetentionSpecificationFixture.cs" />
|
||||||
<Compile Include="DecisionEngineTests\QualityAllowedByProfileSpecificationFixture.cs" />
|
<Compile Include="DecisionEngineTests\QualityAllowedByProfileSpecificationFixture.cs" />
|
||||||
|
@ -0,0 +1,43 @@
|
|||||||
|
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;
|
||||||
|
using NzbDrone.Test.Common;
|
||||||
|
|
||||||
|
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)
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
series.Id = Db.Insert(series).Id;
|
||||||
|
|
||||||
|
var episode = Builder<Episode>.CreateNew()
|
||||||
|
.With(e => e.Id = 0)
|
||||||
|
.With(e => e.SeriesId = series.Id)
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
Db.Insert(episode);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void should_get_episodes_with_attached_series()
|
||||||
|
{
|
||||||
|
var episodes = Subject.EpisodesBetweenDates(DateTime.Today.AddDays(-1), DateTime.Today.AddDays(3));
|
||||||
|
episodes.Should().HaveCount(1);
|
||||||
|
episodes.First().Series.Should().NotBeNull();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user