2013-04-21 01:14:41 +03:00
|
|
|
using System.Net;
|
|
|
|
using FluentAssertions;
|
2013-04-19 07:46:18 +03:00
|
|
|
using NUnit.Framework;
|
|
|
|
using NzbDrone.Api.Series;
|
2013-04-22 06:18:08 +03:00
|
|
|
using System.Linq;
|
2013-04-19 07:46:18 +03:00
|
|
|
|
|
|
|
namespace NzbDrone.Integration.Test
|
|
|
|
{
|
|
|
|
[TestFixture]
|
2013-04-22 06:18:08 +03:00
|
|
|
public class SeriesIntegrationTest : IntegrationTest
|
2013-04-19 07:46:18 +03:00
|
|
|
{
|
|
|
|
[Test]
|
|
|
|
public void should_have_no_series_on_start_application()
|
|
|
|
{
|
2013-04-22 06:18:08 +03:00
|
|
|
Series.All().Should().BeEmpty();
|
2013-04-19 07:46:18 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void series_lookup_on_trakt()
|
|
|
|
{
|
|
|
|
var series = Series.Lookup("archer");
|
|
|
|
|
|
|
|
series.Should().NotBeEmpty();
|
|
|
|
series.Should().Contain(c => c.Title == "Archer (2009)");
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
2013-04-21 01:14:41 +03:00
|
|
|
public void add_series_without_required_fields_should_return_badrequest()
|
2013-04-19 07:46:18 +03:00
|
|
|
{
|
2013-04-21 01:14:41 +03:00
|
|
|
var errors = Series.InvalidPost(new SeriesResource());
|
|
|
|
errors.Should().NotBeEmpty();
|
2013-04-19 07:46:18 +03:00
|
|
|
}
|
|
|
|
|
2013-04-22 06:18:08 +03:00
|
|
|
[Test]
|
|
|
|
public void should_be_able_to_add_series()
|
|
|
|
{
|
|
|
|
var series = Series.Lookup("archer").First();
|
|
|
|
|
|
|
|
Series.Post(series);
|
|
|
|
|
|
|
|
Series.All().Should().HaveCount(1);
|
|
|
|
}
|
2013-04-19 07:46:18 +03:00
|
|
|
}
|
|
|
|
}
|