parent
c5661cba04
commit
641f8a88fa
@ -0,0 +1,31 @@
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using Lidarr.Api.V3.Indexers;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace NzbDrone.Integration.Test.ApiTests
|
||||
{
|
||||
[TestFixture]
|
||||
public class ReleasePushFixture : IntegrationTest
|
||||
{
|
||||
[Test]
|
||||
public void should_have_utc_date()
|
||||
{
|
||||
var body = new Dictionary<string, object>();
|
||||
body.Add("guid", "sdfsdfsdf");
|
||||
body.Add("title", "The Artist - The Album");
|
||||
body.Add("publishDate", DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ssZ", CultureInfo.InvariantCulture));
|
||||
|
||||
var request = ReleasePush.BuildRequest();
|
||||
request.AddBody(body);
|
||||
var result = ReleasePush.Post<ReleaseResource>(request, HttpStatusCode.OK);
|
||||
|
||||
result.Should().NotBeNull();
|
||||
result.AgeHours.Should().BeApproximately(0, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
using Lidarr.Api.V3.Indexers;
|
||||
using RestSharp;
|
||||
|
||||
namespace NzbDrone.Integration.Test.Client
|
||||
{
|
||||
public class ReleasePushClient : ClientBase<ReleaseResource>
|
||||
{
|
||||
public ReleasePushClient(IRestClient restClient, string apiKey)
|
||||
: base(restClient, apiKey, "release/push")
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue