sonarr-repo-only/NzbDrone.Integration.Test/SeriesIntegrationTest.cs

54 lines
1.4 KiB
C#
Raw Normal View History

2013-04-22 07:21:39 +00:00
using System.IO;
using System.Net;
2013-04-20 22:14:41 +00:00
using FluentAssertions;
2013-04-19 04:46:18 +00:00
using NUnit.Framework;
2013-04-22 07:21:39 +00:00
using NzbDrone.Api.RootFolders;
2013-04-19 04:46:18 +00:00
using NzbDrone.Api.Series;
using System.Linq;
2013-04-19 04:46:18 +00:00
namespace NzbDrone.Integration.Test
{
[TestFixture]
public class SeriesIntegrationTest : IntegrationTest
2013-04-19 04:46:18 +00:00
{
[Test]
public void should_have_no_series_on_start_application()
{
Series.All().Should().BeEmpty();
2013-04-19 04:46:18 +00: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-20 22:14:41 +00:00
public void add_series_without_required_fields_should_return_badrequest()
2013-04-19 04:46:18 +00:00
{
2013-04-20 22:14:41 +00:00
var errors = Series.InvalidPost(new SeriesResource());
errors.Should().NotBeEmpty();
2013-04-19 04:46:18 +00:00
}
[Test]
public void should_be_able_to_add_and_delete_series()
{
var series = Series.Lookup("archer").First();
2013-04-22 07:21:39 +00:00
var rootFolder = RootFolders.Post(new RootFolderResource { Path = Directory.GetCurrentDirectory() });
series.RootFolderId = rootFolder.Id;
Series.Post(series);
Series.All().Should().HaveCount(1);
Series.Delete(series.Id);
Series.All().Should().BeEmpty();
}
2013-04-19 04:46:18 +00:00
}
}