mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
moved seriesmodule to restmodule
This commit is contained in:
parent
4afec69c79
commit
d85b825e06
11 changed files with 142 additions and 43 deletions
|
@ -1,7 +1,10 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using FluentAssertions;
|
||||
using FluentValidation;
|
||||
using FluentValidation.Results;
|
||||
using NLog;
|
||||
using Newtonsoft.Json;
|
||||
using RestSharp;
|
||||
|
||||
namespace NzbDrone.Integration.Test.Client
|
||||
|
@ -33,6 +36,13 @@ namespace NzbDrone.Integration.Test.Client
|
|||
return Post<TResource>(request);
|
||||
}
|
||||
|
||||
public List<string> InvalidPost(TResource body)
|
||||
{
|
||||
var request = BuildRequest();
|
||||
request.AddBody(body);
|
||||
return Post<List<string>>(request, HttpStatusCode.BadRequest);
|
||||
}
|
||||
|
||||
protected RestRequest BuildRequest(string command = "")
|
||||
{
|
||||
return new RestRequest(_resource + "/" + command.Trim('/'))
|
||||
|
@ -58,9 +68,10 @@ namespace NzbDrone.Integration.Test.Client
|
|||
_logger.Info("{0}: {1}", request.Method, _restClient.BuildUri(request));
|
||||
|
||||
var response = _restClient.Execute<T>(request);
|
||||
|
||||
_logger.Info("Response: {0}", response.Content);
|
||||
|
||||
response.StatusCode.Should().Be(statusCode);
|
||||
|
||||
if (response.ErrorException != null)
|
||||
{
|
||||
throw response.ErrorException;
|
||||
|
@ -68,9 +79,6 @@ namespace NzbDrone.Integration.Test.Client
|
|||
|
||||
response.ErrorMessage.Should().BeBlank();
|
||||
|
||||
|
||||
response.StatusCode.Should().Be(statusCode);
|
||||
|
||||
return response.Data;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue