mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 21:43:33 -07:00
added basic signalr connection integration tests
This commit is contained in:
parent
82378a8628
commit
4a530a6c91
3 changed files with 32 additions and 1 deletions
|
@ -1,5 +1,8 @@
|
|||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using FluentAssertions;
|
||||
using Microsoft.AspNet.SignalR.Client;
|
||||
using Microsoft.AspNet.SignalR.Client.Transports;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Api.RootFolders;
|
||||
|
||||
|
@ -8,6 +11,30 @@ namespace NzbDrone.Integration.Test
|
|||
[TestFixture]
|
||||
public class RootFolderIntegrationTest : IntegrationTest
|
||||
{
|
||||
private Connection _connection;
|
||||
private List<object> _signalRReceived;
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
_signalRReceived = new List<object>();
|
||||
_connection = new Connection("http://localhost:8989/signalr/rootfolder");
|
||||
_connection.Start(new LongPollingTransport()).ContinueWith(task =>
|
||||
{
|
||||
if (task.IsFaulted)
|
||||
{
|
||||
Assert.Fail("SignalrConnection failed. {0}", task.Exception.GetBaseException());
|
||||
}
|
||||
});
|
||||
|
||||
_connection.Received += _connection_Received;
|
||||
}
|
||||
|
||||
private void _connection_Received(string obj)
|
||||
{
|
||||
_signalRReceived.Add(obj);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_have_no_root_folder_initially()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue