diff --git a/build/dependencies.props b/build/dependencies.props index e96db6ae96..9525423820 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -12,16 +12,10 @@ 2.0.0-* 1.2.4 2.0.0-* - 15.3.0-* - 2.3.0-beta3-* + 15.3.0 + 2.3.0-beta4-build3742 3.1.1 0.9.0-beta2 4.3.0 - - $(NoWarn);AD0001 diff --git a/test/Microsoft.AspNetCore.SignalR.Client.Tests/LongPollingTransportTests.cs b/test/Microsoft.AspNetCore.SignalR.Client.Tests/LongPollingTransportTests.cs index 3a3f760ab4..9c6f9fbb6c 100644 --- a/test/Microsoft.AspNetCore.SignalR.Client.Tests/LongPollingTransportTests.cs +++ b/test/Microsoft.AspNetCore.SignalR.Client.Tests/LongPollingTransportTests.cs @@ -316,7 +316,7 @@ namespace Microsoft.AspNetCore.Client.Tests Assert.Equal(2, sentRequests.Count); // Check the messages received - Assert.Equal(1, messages.Count); + Assert.Single(messages); Assert.Equal(message1Payload, messages[0]); } finally @@ -369,7 +369,7 @@ namespace Microsoft.AspNetCore.Client.Tests await longPollingTransport.Running.OrTimeout(); await connectionToTransport.In.Completion.OrTimeout(); - Assert.Equal(1, sentRequests.Count); + Assert.Single(sentRequests); Assert.Equal(new byte[] { (byte)'H', (byte)'e', (byte)'l', (byte)'l', (byte)'o', (byte)'W', (byte)'o', (byte)'r', (byte)'l', (byte)'d' }, sentRequests[0]); } diff --git a/test/Microsoft.AspNetCore.SignalR.Common.Tests/Internal/Encoders/LengthPrefixedTextMessageFormatterTests.cs b/test/Microsoft.AspNetCore.SignalR.Common.Tests/Internal/Encoders/LengthPrefixedTextMessageFormatterTests.cs index 8abb2c70e8..8df95e61f9 100644 --- a/test/Microsoft.AspNetCore.SignalR.Common.Tests/Internal/Encoders/LengthPrefixedTextMessageFormatterTests.cs +++ b/test/Microsoft.AspNetCore.SignalR.Common.Tests/Internal/Encoders/LengthPrefixedTextMessageFormatterTests.cs @@ -30,11 +30,10 @@ namespace Microsoft.AspNetCore.SignalR.Tests.Internal.Encoders } [Theory] - [InlineData(8, "0:;", "")] - [InlineData(8, "3:ABC;", "ABC")] - [InlineData(8, "11:A\nR\rC\r\n;DEF;", "A\nR\rC\r\n;DEF")] - [InlineData(256, "11:A\nR\rC\r\n;DEF;", "A\nR\rC\r\n;DEF")] - public void WriteMessage(int chunkSize, string encoded, string payload) + [InlineData("0:;", "")] + [InlineData("3:ABC;", "ABC")] + [InlineData("11:A\nR\rC\r\n;DEF;", "A\nR\rC\r\n;DEF")] + public void WriteMessage(string encoded, string payload) { var message = Encoding.UTF8.GetBytes(payload); var output = new MemoryStream(); diff --git a/test/Microsoft.AspNetCore.SignalR.Common.Tests/Internal/Encoders/LengthPrefixedTextMessageParserTests.cs b/test/Microsoft.AspNetCore.SignalR.Common.Tests/Internal/Encoders/LengthPrefixedTextMessageParserTests.cs index 5716daaa90..78e296ce29 100644 --- a/test/Microsoft.AspNetCore.SignalR.Common.Tests/Internal/Encoders/LengthPrefixedTextMessageParserTests.cs +++ b/test/Microsoft.AspNetCore.SignalR.Common.Tests/Internal/Encoders/LengthPrefixedTextMessageParserTests.cs @@ -12,11 +12,11 @@ namespace Microsoft.AspNetCore.SignalR.Common.Tests.Internal.Encoders public class LengthPrefixedTextMessageParserTests { [Theory] - [InlineData(0, "0:;", "")] - [InlineData(0, "3:ABC;", "ABC")] - [InlineData(0, "11:A\nR\rC\r\n;DEF;", "A\nR\rC\r\n;DEF")] - [InlineData(4, "12:Hello, World;", "Hello, World")] - public void ReadTextMessage(int chunkSize, string encoded, string payload) + [InlineData("0:;", "")] + [InlineData("3:ABC;", "ABC")] + [InlineData("11:A\nR\rC\r\n;DEF;", "A\nR\rC\r\n;DEF")] + [InlineData("12:Hello, World;", "Hello, World")] + public void ReadTextMessage(string encoded, string payload) { ReadOnlyBuffer buffer = Encoding.UTF8.GetBytes(encoded); diff --git a/test/Microsoft.AspNetCore.SignalR.Common.Tests/Internal/Formatters/BinaryMessageFormatterTests.cs b/test/Microsoft.AspNetCore.SignalR.Common.Tests/Internal/Formatters/BinaryMessageFormatterTests.cs index 6ce23c611e..983d0c6114 100644 --- a/test/Microsoft.AspNetCore.SignalR.Common.Tests/Internal/Formatters/BinaryMessageFormatterTests.cs +++ b/test/Microsoft.AspNetCore.SignalR.Common.Tests/Internal/Formatters/BinaryMessageFormatterTests.cs @@ -38,13 +38,11 @@ namespace Microsoft.AspNetCore.Sockets.Tests.Internal.Formatters } [Theory] - [InlineData(0, 8, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, new byte[0])] - [InlineData(0, 8, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xAB, 0xCD, 0xEF, 0x12 }, new byte[] { 0xAB, 0xCD, 0xEF, 0x12 })] - [InlineData(4, 8, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, new byte[0])] - [InlineData(4, 8, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xAB, 0xCD, 0xEF, 0x12 }, new byte[] { 0xAB, 0xCD, 0xEF, 0x12 })] - [InlineData(0, 256, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, new byte[0])] - [InlineData(0, 256, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xAB, 0xCD, 0xEF, 0x12 }, new byte[] { 0xAB, 0xCD, 0xEF, 0x12 })] - public void WriteBinaryMessage(int offset, int chunkSize, byte[] encoded, byte[] payload) + [InlineData(0, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, new byte[0])] + [InlineData(0, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xAB, 0xCD, 0xEF, 0x12 }, new byte[] { 0xAB, 0xCD, 0xEF, 0x12 })] + [InlineData(4, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, new byte[0])] + [InlineData(4, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xAB, 0xCD, 0xEF, 0x12 }, new byte[] { 0xAB, 0xCD, 0xEF, 0x12 })] + public void WriteBinaryMessage(int offset, byte[] encoded, byte[] payload) { var output = new MemoryStream(); @@ -59,12 +57,11 @@ namespace Microsoft.AspNetCore.Sockets.Tests.Internal.Formatters } [Theory] - [InlineData(0, 8, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, "")] - [InlineData(0, 8, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x41, 0x42, 0x43 }, "ABC")] - [InlineData(0, 8, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x41, 0x0A, 0x52, 0x0D, 0x43, 0x0D, 0x0A, 0x3B, 0x44, 0x45, 0x46 }, "A\nR\rC\r\n;DEF")] - [InlineData(4, 8, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, "")] - [InlineData(0, 256, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, "")] - public void WriteTextMessage(int offset, int chunkSize, byte[] encoded, string payload) + [InlineData(0, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, "")] + [InlineData(0, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x41, 0x42, 0x43 }, "ABC")] + [InlineData(0, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x41, 0x0A, 0x52, 0x0D, 0x43, 0x0D, 0x0A, 0x3B, 0x44, 0x45, 0x46 }, "A\nR\rC\r\n;DEF")] + [InlineData(4, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, "")] + public void WriteTextMessage(int offset, byte[] encoded, string payload) { var message = Encoding.UTF8.GetBytes(payload); var output = new MemoryStream(); diff --git a/test/Microsoft.AspNetCore.SignalR.Tests/EndToEndTests.cs b/test/Microsoft.AspNetCore.SignalR.Tests/EndToEndTests.cs index 37240d13f0..4779eb3d0f 100644 --- a/test/Microsoft.AspNetCore.SignalR.Tests/EndToEndTests.cs +++ b/test/Microsoft.AspNetCore.SignalR.Tests/EndToEndTests.cs @@ -97,9 +97,12 @@ namespace Microsoft.AspNetCore.SignalR.Tests } } +// Suppress this warning to workaround https://github.com/xunit/xunit/issues/1424 +#pragma warning disable xUnit1026 [Theory] [MemberData(nameof(TransportTypesAndTransferModes))] public async Task ConnectionCanSendAndReceiveMessages(TransportType transportType, TransferMode requestedTransferMode) +#pragma warning restore xUnit1026 { using (StartLog(out var loggerFactory, testName: $"ConnectionCanSendAndReceiveMessages_{transportType.ToString()}")) { diff --git a/test/Microsoft.AspNetCore.SignalR.Tests/HubEndpointTests.cs b/test/Microsoft.AspNetCore.SignalR.Tests/HubEndpointTests.cs index 4fbaf6d2a1..79d2a29e25 100644 --- a/test/Microsoft.AspNetCore.SignalR.Tests/HubEndpointTests.cs +++ b/test/Microsoft.AspNetCore.SignalR.Tests/HubEndpointTests.cs @@ -499,7 +499,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests { var invocation = Assert.IsType(result); Assert.Equal("Broadcast", invocation.Target); - Assert.Equal(1, invocation.Arguments.Length); + Assert.Single(invocation.Arguments); Assert.Equal("test", invocation.Arguments[0]); } @@ -587,7 +587,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests var hubMessage = await secondClient.ReadAsync().OrTimeout(); var invocation = Assert.IsType(hubMessage); Assert.Equal("Send", invocation.Target); - Assert.Equal(1, invocation.Arguments.Length); + Assert.Single(invocation.Arguments); Assert.Equal("test", invocation.Arguments[0]); // kill the connections @@ -640,7 +640,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests var hubMessage = await secondClient.ReadAsync().OrTimeout(); var invocation = Assert.IsType(hubMessage); Assert.Equal("Send", invocation.Target); - Assert.Equal(1, invocation.Arguments.Length); + Assert.Single(invocation.Arguments); Assert.Equal("test", invocation.Arguments[0]); // kill the connections @@ -673,7 +673,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests var hubMessage = await secondClient.ReadAsync().OrTimeout(); var invocation = Assert.IsType(hubMessage); Assert.Equal("Send", invocation.Target); - Assert.Equal(1, invocation.Arguments.Length); + Assert.Single(invocation.Arguments); Assert.Equal("test", invocation.Arguments[0]); // kill the connections @@ -705,7 +705,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests var hubMessage = await secondClient.ReadAsync().OrTimeout(); var invocation = Assert.IsType(hubMessage); Assert.Equal("Send", invocation.Target); - Assert.Equal(1, invocation.Arguments.Length); + Assert.Single(invocation.Arguments); Assert.Equal("test", invocation.Arguments[0]); // kill the connections