Change Read to ReadAsync (#702)
This commit is contained in:
parent
e2cec0b305
commit
8cda36157f
|
|
@ -459,8 +459,8 @@ namespace Microsoft.AspNetCore.SignalR.Tests
|
||||||
await firstClient.SendInvocationAsync("BroadcastMethod", "test").OrTimeout();
|
await firstClient.SendInvocationAsync("BroadcastMethod", "test").OrTimeout();
|
||||||
|
|
||||||
foreach (var result in await Task.WhenAll(
|
foreach (var result in await Task.WhenAll(
|
||||||
firstClient.Read(),
|
firstClient.ReadAsync(),
|
||||||
secondClient.Read()).OrTimeout())
|
secondClient.ReadAsync()).OrTimeout())
|
||||||
{
|
{
|
||||||
var invocation = Assert.IsType<InvocationMessage>(result);
|
var invocation = Assert.IsType<InvocationMessage>(result);
|
||||||
Assert.Equal("Broadcast", invocation.Target);
|
Assert.Equal("Broadcast", invocation.Target);
|
||||||
|
|
@ -505,7 +505,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests
|
||||||
await firstClient.SendInvocationAsync(nameof(MethodHub.GroupSendMethod), "testGroup", "test").OrTimeout();
|
await firstClient.SendInvocationAsync(nameof(MethodHub.GroupSendMethod), "testGroup", "test").OrTimeout();
|
||||||
|
|
||||||
// check that 'secondConnection' has received the group send
|
// check that 'secondConnection' has received the group send
|
||||||
var hubMessage = await secondClient.Read().OrTimeout();
|
var hubMessage = await secondClient.ReadAsync().OrTimeout();
|
||||||
var invocation = Assert.IsType<InvocationMessage>(hubMessage);
|
var invocation = Assert.IsType<InvocationMessage>(hubMessage);
|
||||||
Assert.Equal("Send", invocation.Target);
|
Assert.Equal("Send", invocation.Target);
|
||||||
Assert.Equal(1, invocation.Arguments.Length);
|
Assert.Equal(1, invocation.Arguments.Length);
|
||||||
|
|
@ -558,7 +558,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests
|
||||||
await firstClient.SendInvocationAsync("ClientSendMethod", secondClient.Connection.User.Identity.Name, "test").OrTimeout();
|
await firstClient.SendInvocationAsync("ClientSendMethod", secondClient.Connection.User.Identity.Name, "test").OrTimeout();
|
||||||
|
|
||||||
// check that 'secondConnection' has received the group send
|
// check that 'secondConnection' has received the group send
|
||||||
var hubMessage = await secondClient.Read().OrTimeout();
|
var hubMessage = await secondClient.ReadAsync().OrTimeout();
|
||||||
var invocation = Assert.IsType<InvocationMessage>(hubMessage);
|
var invocation = Assert.IsType<InvocationMessage>(hubMessage);
|
||||||
Assert.Equal("Send", invocation.Target);
|
Assert.Equal("Send", invocation.Target);
|
||||||
Assert.Equal(1, invocation.Arguments.Length);
|
Assert.Equal(1, invocation.Arguments.Length);
|
||||||
|
|
@ -591,7 +591,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests
|
||||||
await firstClient.SendInvocationAsync("ConnectionSendMethod", secondClient.Connection.ConnectionId, "test").OrTimeout();
|
await firstClient.SendInvocationAsync("ConnectionSendMethod", secondClient.Connection.ConnectionId, "test").OrTimeout();
|
||||||
|
|
||||||
// check that 'secondConnection' has received the group send
|
// check that 'secondConnection' has received the group send
|
||||||
var hubMessage = await secondClient.Read().OrTimeout();
|
var hubMessage = await secondClient.ReadAsync().OrTimeout();
|
||||||
var invocation = Assert.IsType<InvocationMessage>(hubMessage);
|
var invocation = Assert.IsType<InvocationMessage>(hubMessage);
|
||||||
Assert.Equal("Send", invocation.Target);
|
Assert.Equal("Send", invocation.Target);
|
||||||
Assert.Equal(1, invocation.Arguments.Length);
|
Assert.Equal(1, invocation.Arguments.Length);
|
||||||
|
|
@ -623,7 +623,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests
|
||||||
await firstClient.SendInvocationAsync("DelayedSend", secondClient.Connection.ConnectionId, "test").OrTimeout();
|
await firstClient.SendInvocationAsync("DelayedSend", secondClient.Connection.ConnectionId, "test").OrTimeout();
|
||||||
|
|
||||||
// check that 'secondConnection' has received the group send
|
// check that 'secondConnection' has received the group send
|
||||||
var hubMessage = await secondClient.Read().OrTimeout();
|
var hubMessage = await secondClient.ReadAsync().OrTimeout();
|
||||||
var invocation = Assert.IsType<InvocationMessage>(hubMessage);
|
var invocation = Assert.IsType<InvocationMessage>(hubMessage);
|
||||||
Assert.Equal("Send", invocation.Target);
|
Assert.Equal("Send", invocation.Target);
|
||||||
Assert.Equal(1, invocation.Arguments.Length);
|
Assert.Equal(1, invocation.Arguments.Length);
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests
|
||||||
var messages = new List<HubMessage>();
|
var messages = new List<HubMessage>();
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
var message = await Read();
|
var message = await ReadAsync();
|
||||||
|
|
||||||
if (message == null)
|
if (message == null)
|
||||||
{
|
{
|
||||||
|
|
@ -92,7 +92,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
var message = await Read();
|
var message = await ReadAsync();
|
||||||
|
|
||||||
if (message == null)
|
if (message == null)
|
||||||
{
|
{
|
||||||
|
|
@ -131,7 +131,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests
|
||||||
return invocationId;
|
return invocationId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<HubMessage> Read()
|
public async Task<HubMessage> ReadAsync()
|
||||||
{
|
{
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue