|
|
@ -10,20 +10,28 @@ namespace NzbDrone.Integration.Test
|
|
|
|
[TestFixture]
|
|
|
|
[TestFixture]
|
|
|
|
public class EpisodeIntegrationTests : IntegrationTest
|
|
|
|
public class EpisodeIntegrationTests : IntegrationTest
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
private SeriesResource series;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[SetUp]
|
|
|
|
|
|
|
|
public void Setup()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
series = GivenSeriesWithEpisodes();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private SeriesResource GivenSeriesWithEpisodes()
|
|
|
|
private SeriesResource GivenSeriesWithEpisodes()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var series = Series.Lookup("archer").First();
|
|
|
|
var newSeries = Series.Lookup("archer").First();
|
|
|
|
|
|
|
|
|
|
|
|
series.QualityProfileId = 1;
|
|
|
|
newSeries.QualityProfileId = 1;
|
|
|
|
series.Path = @"C:\Test\Archer".AsOsAgnostic();
|
|
|
|
newSeries.Path = @"C:\Test\Archer".AsOsAgnostic();
|
|
|
|
|
|
|
|
|
|
|
|
series = Series.Post(series);
|
|
|
|
newSeries = Series.Post(newSeries);
|
|
|
|
|
|
|
|
|
|
|
|
while (true)
|
|
|
|
while (true)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (Episodes.GetEpisodesInSeries(series.Id).Count > 0)
|
|
|
|
if (Episodes.GetEpisodesInSeries(newSeries.Id).Count > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return series;
|
|
|
|
return newSeries;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Thread.Sleep(1000);
|
|
|
|
Thread.Sleep(1000);
|
|
|
@ -33,28 +41,33 @@ namespace NzbDrone.Integration.Test
|
|
|
|
[Test]
|
|
|
|
[Test]
|
|
|
|
public void should_be_able_to_get_all_episodes_in_series()
|
|
|
|
public void should_be_able_to_get_all_episodes_in_series()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var series = GivenSeriesWithEpisodes();
|
|
|
|
|
|
|
|
Episodes.GetEpisodesInSeries(series.Id).Count.Should().BeGreaterThan(0);
|
|
|
|
Episodes.GetEpisodesInSeries(series.Id).Count.Should().BeGreaterThan(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
[Test]
|
|
|
|
public void should_be_able_to_get_a_single_episode()
|
|
|
|
public void should_be_able_to_get_a_single_episode()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var series = GivenSeriesWithEpisodes();
|
|
|
|
|
|
|
|
var episodes = Episodes.GetEpisodesInSeries(series.Id);
|
|
|
|
var episodes = Episodes.GetEpisodesInSeries(series.Id);
|
|
|
|
|
|
|
|
|
|
|
|
Episodes.Get(episodes.First().Id).Should().NotBeNull();
|
|
|
|
Episodes.Get(episodes.First().Id).Should().NotBeNull();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
[Test]
|
|
|
|
public void should_be_able_to_set_monitor_status_via_api()
|
|
|
|
public void should_be_able_to_set_monitor_status()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var series = GivenSeriesWithEpisodes();
|
|
|
|
|
|
|
|
var episodes = Episodes.GetEpisodesInSeries(series.Id);
|
|
|
|
var episodes = Episodes.GetEpisodesInSeries(series.Id);
|
|
|
|
var updatedEpisode = episodes.First();
|
|
|
|
var updatedEpisode = episodes.First();
|
|
|
|
updatedEpisode.Monitored = false;
|
|
|
|
updatedEpisode.Monitored = false;
|
|
|
|
|
|
|
|
|
|
|
|
Episodes.Put(updatedEpisode).Monitored.Should().BeFalse();
|
|
|
|
Episodes.Put(updatedEpisode).Monitored.Should().BeFalse();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[TearDown]
|
|
|
|
|
|
|
|
public void TearDown()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Series.Delete(series.Id);
|
|
|
|
|
|
|
|
Thread.Sleep(2000);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|