Add Hub<T> Functional Tests (#891)
This commit is contained in:
parent
4841444d60
commit
e42f6980b6
|
|
@ -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[]
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests
|
|||
{
|
||||
routes.MapHub<TestHub>("default");
|
||||
routes.MapHub<DynamicTestHub>("dynamic");
|
||||
routes.MapHub<TestHubT>("hubT");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue