mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
improved clone injection.
This commit is contained in:
parent
0861e5f8c1
commit
b3c9217412
@ -17,9 +17,10 @@ protected override bool Match(ConventionInfo conventionInfo)
|
||||
|
||||
protected override object SetValue(ConventionInfo conventionInfo)
|
||||
{
|
||||
if (conventionInfo.SourceProp.Type.IsValueType || conventionInfo.SourceProp.Type == typeof(string))
|
||||
if (conventionInfo.SourceProp.Type == conventionInfo.TargetProp.Type)
|
||||
return conventionInfo.SourceProp.Value;
|
||||
|
||||
|
||||
if (conventionInfo.SourceProp.Type.IsArray)
|
||||
{
|
||||
var array = (Array)conventionInfo.SourceProp.Value;
|
||||
|
@ -86,7 +86,7 @@ public List<dynamic> InvalidPost(TResource body)
|
||||
return Post<List<dynamic>>(request, HttpStatusCode.BadRequest);
|
||||
}
|
||||
|
||||
protected RestRequest BuildRequest(string command = "")
|
||||
public RestRequest BuildRequest(string command = "")
|
||||
{
|
||||
return new RestRequest(_resource + "/" + command.Trim('/'))
|
||||
{
|
||||
@ -94,7 +94,7 @@ protected RestRequest BuildRequest(string command = "")
|
||||
};
|
||||
}
|
||||
|
||||
protected T Get<T>(IRestRequest request, HttpStatusCode statusCode = HttpStatusCode.OK) where T : class, new()
|
||||
public T Get<T>(IRestRequest request, HttpStatusCode statusCode = HttpStatusCode.OK) where T : class, new()
|
||||
{
|
||||
request.Method = Method.GET;
|
||||
return Execute<T>(request, statusCode);
|
||||
|
@ -1,5 +1,7 @@
|
||||
using FluentAssertions;
|
||||
using System.Net;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Api.History;
|
||||
|
||||
namespace NzbDrone.Integration.Test
|
||||
{
|
||||
@ -9,7 +11,7 @@ public class HistoryIntegrationTest : IntegrationTest
|
||||
[Test]
|
||||
public void history_should_be_empty()
|
||||
{
|
||||
var history = History.GetPaged(1,15,"date","desc");
|
||||
var history = History.GetPaged(1, 15, "date", "desc");
|
||||
|
||||
history.Records.Count.Should().Be(0);
|
||||
history.Page.Should().Be(1);
|
||||
|
Loading…
Reference in New Issue
Block a user