Skip to content

Commit

Permalink
Added a test to verify that dispose is calling stop on a connection a…
Browse files Browse the repository at this point in the history
…nd it's then aborting the active connection.

#1844
  • Loading branch information
NTaylorMullen committed Apr 20, 2013
1 parent 980125e commit 90c5916
Showing 1 changed file with 24 additions and 0 deletions.
Expand Up @@ -11,6 +11,30 @@ namespace Microsoft.AspNet.SignalR.Tests
{
public class ConnectionFacts : HostedTest
{
[Theory]
[InlineData(HostType.Memory, TransportType.ServerSentEvents)]
[InlineData(HostType.Memory, TransportType.LongPolling)]
[InlineData(HostType.IISExpress, TransportType.LongPolling)]
[InlineData(HostType.IISExpress, TransportType.ServerSentEvents)]
[InlineData(HostType.IISExpress, TransportType.Websockets)]
public void ConnectionDisposeTriggersStop(HostType hostType, TransportType transportType)
{
using (var host = CreateHost(hostType, transportType))
{
host.Initialize();
var connection = CreateConnection(host,"/signalr");

using (connection)
{
connection.Start(host.Transport).Wait();
Assert.Equal(connection.State, Client.ConnectionState.Connected);
}

Assert.Equal(connection.State, Client.ConnectionState.Disconnected);
}
}


[Theory]
[InlineData(HostType.IISExpress, TransportType.LongPolling)]
[InlineData(HostType.IISExpress, TransportType.ServerSentEvents)]
Expand Down

0 comments on commit 90c5916

Please sign in to comment.