Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Commit a54ca5d

Browse files
committed
feedback and fix build error
1 parent c4f910b commit a54ca5d

File tree

6 files changed

+12
-16
lines changed

6 files changed

+12
-16
lines changed

src/Microsoft.AspNetCore.SignalR.Client.Core/Internal/SignalRClientLoggerExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ public static void ErrorInvokingClientSideMethod(this ILogger logger, string met
290290

291291
public static void ResettingKeepAliveTimer(this ILogger logger)
292292
{
293-
_resettingKeepAliveTimer(logger);
293+
_resettingKeepAliveTimer(logger, null);
294294
}
295295
}
296296
}

src/Microsoft.AspNetCore.SignalR.Common/Internal/Protocol/HubProtocolConstants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace Microsoft.AspNetCore.SignalR.Internal.Protocol
22
{
3-
internal static class HubProtocolConstants
3+
public static class HubProtocolConstants
44
{
55
public const int InvocationMessageType = 1;
66
public const int StreamItemMessageType = 2;

test/Microsoft.AspNetCore.SignalR.Client.FunctionalTests/HubConnectionTests.cs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -679,12 +679,6 @@ public async Task KeepAliveBehaviorIsCorrect(TransportType transportType)
679679
await hubConnection.InvokeAsync("Echo", "foo");
680680
await Task.Delay(50);
681681
Assert.False(hubConnection.Closed.IsCompleted);
682-
683-
if (transportType != TransportType.LongPolling)
684-
{
685-
var ex = await Assert.ThrowsAsync<TimeoutException>(async () => await hubConnection.Closed.OrTimeout(milliseconds: 500));
686-
Assert.Equal("Server timeout elapsed without receiving a message from the server.", ex.Message);
687-
}
688682
}
689683
catch (Exception ex)
690684
{
@@ -693,13 +687,15 @@ public async Task KeepAliveBehaviorIsCorrect(TransportType transportType)
693687
}
694688
finally
695689
{
696-
try
690+
if (transportType == TransportType.LongPolling)
697691
{
698692
await hubConnection.DisposeAsync().OrTimeout();
699693
}
700-
catch (TimeoutException) when (transportType != TransportType.LongPolling)
694+
else
701695
{
702-
// Already observed this exception!
696+
// We should have timed out the other transports.
697+
var ex = await Assert.ThrowsAsync<TimeoutException>(async () => await hubConnection.Closed.OrTimeout(milliseconds: 500));
698+
Assert.Equal("Server timeout elapsed without receiving a message from the server.", ex.Message);
703699
}
704700
}
705701
}

test/Microsoft.AspNetCore.SignalR.Client.Tests/HubConnectionTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,11 @@ public async Task ConnectionNotTerminatedIfServerKeepsSending()
212212

213213
try
214214
{
215-
await connection.ReceiveJsonMessage(new { type = 6 });
215+
await connection.ReceiveJsonMessage(new { type = HubProtocolConstants.PingMessageType });
216216
await Task.Delay(50);
217-
await connection.ReceiveJsonMessage(new { type = 6 });
217+
await connection.ReceiveJsonMessage(new { type = HubProtocolConstants.PingMessageType });
218218
await Task.Delay(50);
219-
await connection.ReceiveJsonMessage(new { type = 6 });
219+
await connection.ReceiveJsonMessage(new { type = HubProtocolConstants.PingMessageType });
220220
await Task.Delay(50);
221221

222222
Assert.False(hubConnection.Closed.IsCompleted);

test/Microsoft.AspNetCore.SignalR.Client.Tests/LongPollingTransportTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
using System.Threading;
1010
using System.Threading.Channels;
1111
using System.Threading.Tasks;
12+
using Microsoft.AspNetCore.SignalR.Client.Tests;
1213
using Microsoft.AspNetCore.Sockets;
1314
using Microsoft.AspNetCore.Sockets.Client;
1415
using Microsoft.AspNetCore.Sockets.Internal;
1516
using Moq;
1617
using Moq.Protected;
1718
using Xunit;
18-
using Microsoft.AspNetCore.SignalR.Client.Tests;
1919

2020
namespace Microsoft.AspNetCore.Client.Tests
2121
{

test/Microsoft.AspNetCore.SignalR.Tests/WebSocketsTransportTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
using Microsoft.AspNetCore.Sockets.Internal;
1010
using Microsoft.AspNetCore.Testing.xunit;
1111
using Microsoft.Extensions.Logging.Testing;
12+
using Moq;
1213
using Xunit;
1314
using Xunit.Abstractions;
14-
using Moq;
1515

1616
namespace Microsoft.AspNetCore.SignalR.Tests
1717
{

0 commit comments

Comments
 (0)