added history integration test

This commit is contained in:
kay.one 2013-09-09 22:39:18 -07:00
parent c7bdf4148b
commit 4ddc599668
5 changed files with 38 additions and 0 deletions

View File

@ -2,6 +2,7 @@
using System.Net;
using FluentAssertions;
using NLog;
using NzbDrone.Api;
using NzbDrone.Api.REST;
using NzbDrone.Common.Serializer;
using RestSharp;
@ -35,6 +36,17 @@ namespace NzbDrone.Integration.Test.Client
return Get<List<TResource>>(request);
}
public PagingResource<TResource> GetPaged(int pageNumber, int pageSize, string sortKey, string sortDir)
{
var request = BuildRequest();
request.AddParameter("page", pageNumber);
request.AddParameter("pageSize", pageSize);
request.AddParameter("sortKey", sortKey);
request.AddParameter("sortDir", sortDir);
return Get<PagingResource<TResource>>(request);
}
public TResource Post(TResource body)
{
var request = BuildRequest();

View File

@ -9,6 +9,7 @@ using RestSharp;
namespace NzbDrone.Integration.Test
{
[TestFixture]
[Ignore]
public class CommandIntegrationTest : IntegrationTest
{
[Test]

View File

@ -0,0 +1,21 @@
using FluentAssertions;
using NUnit.Framework;
namespace NzbDrone.Integration.Test
{
[TestFixture]
public class HistoryIntegrationTest : IntegrationTest
{
[Test]
public void history_should_be_empty()
{
var history = History.GetPaged(1,15,"date","desc");
history.Records.Count.Should().Be(0);
history.Page.Should().Be(1);
history.PageSize.Should().Be(15);
history.Records.Should().BeEmpty();
}
}
}

View File

@ -5,6 +5,7 @@ using NLog.Targets;
using NUnit.Framework;
using NzbDrone.Api.Commands;
using NzbDrone.Api.Config;
using NzbDrone.Api.History;
using NzbDrone.Api.RootFolders;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Integration.Test.Client;
@ -23,6 +24,7 @@ namespace NzbDrone.Integration.Test
protected ClientBase<RootFolderResource> RootFolders;
protected ClientBase<CommandResource> Commands;
protected ReleaseClient Releases;
protected ClientBase<HistoryResource> History;
protected IndexerClient Indexers;
protected EpisodeClient Episodes;
protected SeasonClient Seasons;
@ -59,6 +61,7 @@ namespace NzbDrone.Integration.Test
Releases = new ReleaseClient(RestClient);
RootFolders = new ClientBase<RootFolderResource>(RestClient);
Commands = new ClientBase<CommandResource>(RestClient);
History = new ClientBase<HistoryResource>(RestClient);
Indexers = new IndexerClient(RestClient);
Episodes = new EpisodeClient(RestClient);
Seasons = new SeasonClient(RestClient);

View File

@ -100,6 +100,7 @@
<Compile Include="Client\ReleaseClient.cs" />
<Compile Include="Client\SeriesClient.cs" />
<Compile Include="CommandIntegerationTests.cs" />
<Compile Include="HistoryIntegrationTest.cs" />
<Compile Include="NamingConfigTests.cs" />
<Compile Include="SeasonIntegrationTests.cs" />
<Compile Include="EpisodeIntegrationTests.cs" />