mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
Fixing CommandIntegrationTest - for now
This commit is contained in:
parent
1e7db2287e
commit
0894fc0e77
@ -12,7 +12,11 @@ public class TrackedCommand
|
|||||||
public DateTime StateChangeTime { get; set; }
|
public DateTime StateChangeTime { get; set; }
|
||||||
public TimeSpan Runtime { get; set; }
|
public TimeSpan Runtime { get; set; }
|
||||||
public Exception Exception { get; set; }
|
public Exception Exception { get; set; }
|
||||||
|
|
||||||
|
public TrackedCommand()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public TrackedCommand(ICommand command, CommandState state)
|
public TrackedCommand(ICommand command, CommandState state)
|
||||||
{
|
{
|
||||||
Id = command.CommandId;
|
Id = command.CommandId;
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
using NUnit.Framework;
|
using System.Net;
|
||||||
|
using FluentAssertions;
|
||||||
|
using NUnit.Framework;
|
||||||
using NzbDrone.Api.Commands;
|
using NzbDrone.Api.Commands;
|
||||||
|
using NzbDrone.Common.Messaging.Tracking;
|
||||||
|
using NzbDrone.Common.Serializer;
|
||||||
|
using RestSharp;
|
||||||
|
|
||||||
namespace NzbDrone.Integration.Test
|
namespace NzbDrone.Integration.Test
|
||||||
{
|
{
|
||||||
@ -9,7 +14,27 @@ public class CommandIntegrationTest : IntegrationTest
|
|||||||
[Test]
|
[Test]
|
||||||
public void should_be_able_to_run_rss_sync()
|
public void should_be_able_to_run_rss_sync()
|
||||||
{
|
{
|
||||||
Commands.Post(new CommandResource {Command = "rsssync"});
|
var request = new RestRequest("command")
|
||||||
|
{
|
||||||
|
RequestFormat = DataFormat.Json,
|
||||||
|
Method = Method.POST
|
||||||
|
};
|
||||||
|
|
||||||
|
request.AddBody(new CommandResource {Command = "rsssync"});
|
||||||
|
|
||||||
|
var restClient = new RestClient("http://localhost:8989/api");
|
||||||
|
var response = restClient.Execute(request);
|
||||||
|
|
||||||
|
if (response.ErrorException != null)
|
||||||
|
{
|
||||||
|
throw response.ErrorException;
|
||||||
|
}
|
||||||
|
|
||||||
|
response.ErrorMessage.Should().BeBlank();
|
||||||
|
response.StatusCode.Should().Be(HttpStatusCode.Created);
|
||||||
|
|
||||||
|
var trackedCommand = Json.Deserialize<TrackedCommand>(response.Content);
|
||||||
|
trackedCommand.Id.Should().NotBeNullOrEmpty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user