Radarr/src/NzbDrone.Integration.Test/EpisodeIntegrationTests.cs
Mark McDowall 74a38415cf Profiles
Indexes are created with the same uniqueness when copying a table

New: Non-English episode support
New: Renamed Quality Profiles to Profiles and made them more powerful
New: Configurable wait time before grabbing a release to wait for a better quality
2014-07-25 23:21:44 -07:00

73 lines
1.8 KiB
C#

using System.Threading;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Api.Series;
using System.Linq;
using NzbDrone.Test.Common;
namespace NzbDrone.Integration.Test
{
[TestFixture]
public class EpisodeIntegrationTests : IntegrationTest
{
private SeriesResource series;
[SetUp]
public void Setup()
{
series = GivenSeriesWithEpisodes();
}
private SeriesResource GivenSeriesWithEpisodes()
{
var newSeries = Series.Lookup("archer").First();
newSeries.ProfileId = 1;
newSeries.Path = @"C:\Test\Archer".AsOsAgnostic();
newSeries = Series.Post(newSeries);
while (true)
{
if (Episodes.GetEpisodesInSeries(newSeries.Id).Count > 0)
{
return newSeries;
}
Thread.Sleep(1000);
}
}
[Test]
public void should_be_able_to_get_all_episodes_in_series()
{
Episodes.GetEpisodesInSeries(series.Id).Count.Should().BeGreaterThan(0);
}
[Test]
public void should_be_able_to_get_a_single_episode()
{
var episodes = Episodes.GetEpisodesInSeries(series.Id);
Episodes.Get(episodes.First().Id).Should().NotBeNull();
}
[Test]
public void should_be_able_to_set_monitor_status()
{
var episodes = Episodes.GetEpisodesInSeries(series.Id);
var updatedEpisode = episodes.First();
updatedEpisode.Monitored = false;
Episodes.Put(updatedEpisode).Monitored.Should().BeFalse();
}
[TearDown]
public void TearDown()
{
Series.Delete(series.Id);
Thread.Sleep(2000);
}
}
}