mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-18 21:35:51 -04:00
Seasons are now subdocuments of series
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using NzbDrone.Api.Episodes;
|
||||
using NzbDrone.Api.Seasons;
|
||||
using RestSharp;
|
||||
|
||||
namespace NzbDrone.Integration.Test.Client
|
||||
{
|
||||
public class SeasonClient : ClientBase<SeasonResource>
|
||||
{
|
||||
public SeasonClient(IRestClient restClient)
|
||||
: base(restClient)
|
||||
{
|
||||
}
|
||||
|
||||
public List<SeasonResource> GetSeasonsInSeries(int seriesId)
|
||||
{
|
||||
var request = BuildRequest("?seriesId=" + seriesId.ToString());
|
||||
return Get<List<SeasonResource>>(request);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,6 @@ namespace NzbDrone.Integration.Test
|
||||
protected ClientBase<HistoryResource> History;
|
||||
protected IndexerClient Indexers;
|
||||
protected EpisodeClient Episodes;
|
||||
protected SeasonClient Seasons;
|
||||
protected ClientBase<NamingConfigResource> NamingConfig;
|
||||
|
||||
private NzbDroneRunner _runner;
|
||||
@@ -64,7 +63,6 @@ namespace NzbDrone.Integration.Test
|
||||
History = new ClientBase<HistoryResource>(RestClient);
|
||||
Indexers = new IndexerClient(RestClient);
|
||||
Episodes = new EpisodeClient(RestClient);
|
||||
Seasons = new SeasonClient(RestClient);
|
||||
NamingConfig = new ClientBase<NamingConfigResource>(RestClient, "config/naming");
|
||||
}
|
||||
|
||||
@@ -75,5 +73,4 @@ namespace NzbDrone.Integration.Test
|
||||
_runner.KillAll();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -94,7 +94,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Client\ClientBase.cs" />
|
||||
<Compile Include="Client\SeasonClient.cs" />
|
||||
<Compile Include="Client\EpisodeClient.cs" />
|
||||
<Compile Include="Client\IndexerClient.cs" />
|
||||
<Compile Include="Client\ReleaseClient.cs" />
|
||||
@@ -102,7 +101,6 @@
|
||||
<Compile Include="CommandIntegerationTests.cs" />
|
||||
<Compile Include="HistoryIntegrationTest.cs" />
|
||||
<Compile Include="NamingConfigTests.cs" />
|
||||
<Compile Include="SeasonIntegrationTests.cs" />
|
||||
<Compile Include="EpisodeIntegrationTests.cs" />
|
||||
<Compile Include="IndexerIntegrationFixture.cs" />
|
||||
<Compile Include="IntegrationTestDirectoryInfo.cs" />
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
using System;
|
||||
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 SeasonIntegrationTests : IntegrationTest
|
||||
{
|
||||
private SeriesResource GivenSeriesWithEpisodes()
|
||||
{
|
||||
var series = Series.Lookup("archer").First();
|
||||
|
||||
series.QualityProfileId = 1;
|
||||
series.Path = @"C:\Test\Archer".AsOsAgnostic();
|
||||
|
||||
series = Series.Post(series);
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (Seasons.GetSeasonsInSeries(series.Id).Count > 0)
|
||||
{
|
||||
return series;
|
||||
}
|
||||
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_be_able_to_get_all_seasons_in_series()
|
||||
{
|
||||
var series = GivenSeriesWithEpisodes();
|
||||
Seasons.GetSeasonsInSeries(series.Id).Count.Should().BeGreaterThan(0);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_be_able_to_get_a_single_season()
|
||||
{
|
||||
var series = GivenSeriesWithEpisodes();
|
||||
var seasons = Seasons.GetSeasonsInSeries(series.Id);
|
||||
|
||||
Seasons.Get(seasons.First().Id).Should().NotBeNull();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_be_able_to_set_monitor_status_via_api()
|
||||
{
|
||||
var series = GivenSeriesWithEpisodes();
|
||||
var seasons = Seasons.GetSeasonsInSeries(series.Id);
|
||||
var updatedSeason = seasons.First();
|
||||
updatedSeason.Monitored = false;
|
||||
|
||||
Seasons.Put(updatedSeason).Monitored.Should().BeFalse();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user