Add Hub<T> Functional Tests (#891)

This commit is contained in:
Mikael Mengistu 2017-09-15 13:59:44 -07:00 committed by GitHub
parent 4841444d60
commit e42f6980b6
3 changed files with 37 additions and 1 deletions

View File

@ -239,7 +239,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests
}
}
public static string[] HubPaths = new[] { "/default", "/dynamic" };
public static string[] HubPaths = new[] { "/default", "/dynamic", "/hubT" };
public static IEnumerable<IHubProtocol> HubProtocols =>
new IHubProtocol[]

View File

@ -57,4 +57,39 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests
return Clients.All.Send(message);
}
}
public class TestHubT : Hub<ITestHub>
{
public string HelloWorld()
{
return "Hello World!";
}
public string Echo(string message)
{
return message;
}
public async Task CallEcho(string message)
{
await Clients.Client(Context.ConnectionId).Echo(message);
}
public IObservable<string> Stream()
{
return new[] { "a", "b", "c" }.ToObservable();
}
public Task SendMessage(string message)
{
return Clients.All.Send(message);
}
}
public interface ITestHub
{
Task Echo(string message);
Task Send(string message);
}
}

View File

@ -19,6 +19,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests
{
routes.MapHub<TestHub>("default");
routes.MapHub<DynamicTestHub>("dynamic");
routes.MapHub<TestHubT>("hubT");
});
}
}