mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
Episode and Season monitored toggling works again
This commit is contained in:
parent
429460dd5e
commit
6bea671a1a
10 changed files with 200 additions and 3 deletions
60
NzbDrone.Integration.Test/SeasonIntegrationTests.cs
Normal file
60
NzbDrone.Integration.Test/SeasonIntegrationTests.cs
Normal file
|
@ -0,0 +1,60 @@
|
|||
using System;
|
||||
using System.Threading;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Api.Series;
|
||||
using System.Linq;
|
||||
|
||||
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";
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue