Upgrade to xunit 2.3.0-beta4 (#754)

Removes unused theory parameters
This commit is contained in:
Nate McMaster 2017-08-23 10:02:15 -07:00 committed by GitHub
parent 419cedd4f7
commit 629dd34977
7 changed files with 31 additions and 38 deletions

View File

@ -12,16 +12,10 @@
<NETStandardLibraryNETFrameworkVersion>2.0.0-*</NETStandardLibraryNETFrameworkVersion> <NETStandardLibraryNETFrameworkVersion>2.0.0-*</NETStandardLibraryNETFrameworkVersion>
<RedisVersion>1.2.4</RedisVersion> <RedisVersion>1.2.4</RedisVersion>
<RuntimeFrameworkVersion Condition="'$(TargetFramework)'=='netcoreapp2.0'">2.0.0-*</RuntimeFrameworkVersion> <RuntimeFrameworkVersion Condition="'$(TargetFramework)'=='netcoreapp2.0'">2.0.0-*</RuntimeFrameworkVersion>
<TestSdkVersion>15.3.0-*</TestSdkVersion> <TestSdkVersion>15.3.0</TestSdkVersion>
<XunitVersion>2.3.0-beta3-*</XunitVersion> <XunitVersion>2.3.0-beta4-build3742</XunitVersion>
<RxVersion>3.1.1</RxVersion> <RxVersion>3.1.1</RxVersion>
<MsgPackVersion>0.9.0-beta2</MsgPackVersion> <MsgPackVersion>0.9.0-beta2</MsgPackVersion>
<SystemReflectionEmitVersion>4.3.0</SystemReflectionEmitVersion> <SystemReflectionEmitVersion>4.3.0</SystemReflectionEmitVersion>
<!--
TODO remove in next update of xunit
Prevent bug in xunit.analyzer from failing the build.
Should be fixed by https://github.com/xunit/xunit.analyzers/pull/52
-->
<NoWarn>$(NoWarn);AD0001</NoWarn>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@ -316,7 +316,7 @@ namespace Microsoft.AspNetCore.Client.Tests
Assert.Equal(2, sentRequests.Count); Assert.Equal(2, sentRequests.Count);
// Check the messages received // Check the messages received
Assert.Equal(1, messages.Count); Assert.Single(messages);
Assert.Equal(message1Payload, messages[0]); Assert.Equal(message1Payload, messages[0]);
} }
finally finally
@ -369,7 +369,7 @@ namespace Microsoft.AspNetCore.Client.Tests
await longPollingTransport.Running.OrTimeout(); await longPollingTransport.Running.OrTimeout();
await connectionToTransport.In.Completion.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' 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]); }, sentRequests[0]);
} }

View File

@ -30,11 +30,10 @@ namespace Microsoft.AspNetCore.SignalR.Tests.Internal.Encoders
} }
[Theory] [Theory]
[InlineData(8, "0:;", "")] [InlineData("0:;", "")]
[InlineData(8, "3:ABC;", "ABC")] [InlineData("3:ABC;", "ABC")]
[InlineData(8, "11:A\nR\rC\r\n;DEF;", "A\nR\rC\r\n;DEF")] [InlineData("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(string encoded, string payload)
public void WriteMessage(int chunkSize, string encoded, string payload)
{ {
var message = Encoding.UTF8.GetBytes(payload); var message = Encoding.UTF8.GetBytes(payload);
var output = new MemoryStream(); var output = new MemoryStream();

View File

@ -12,11 +12,11 @@ namespace Microsoft.AspNetCore.SignalR.Common.Tests.Internal.Encoders
public class LengthPrefixedTextMessageParserTests public class LengthPrefixedTextMessageParserTests
{ {
[Theory] [Theory]
[InlineData(0, "0:;", "")] [InlineData("0:;", "")]
[InlineData(0, "3:ABC;", "ABC")] [InlineData("3:ABC;", "ABC")]
[InlineData(0, "11:A\nR\rC\r\n;DEF;", "A\nR\rC\r\n;DEF")] [InlineData("11:A\nR\rC\r\n;DEF;", "A\nR\rC\r\n;DEF")]
[InlineData(4, "12:Hello, World;", "Hello, World")] [InlineData("12:Hello, World;", "Hello, World")]
public void ReadTextMessage(int chunkSize, string encoded, string payload) public void ReadTextMessage(string encoded, string payload)
{ {
ReadOnlyBuffer<byte> buffer = Encoding.UTF8.GetBytes(encoded); ReadOnlyBuffer<byte> buffer = Encoding.UTF8.GetBytes(encoded);

View File

@ -38,13 +38,11 @@ namespace Microsoft.AspNetCore.Sockets.Tests.Internal.Formatters
} }
[Theory] [Theory]
[InlineData(0, 8, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, new byte[0])] [InlineData(0, 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(0, 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, 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(4, 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])] public void WriteBinaryMessage(int offset, byte[] encoded, byte[] payload)
[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)
{ {
var output = new MemoryStream(); var output = new MemoryStream();
@ -59,12 +57,11 @@ namespace Microsoft.AspNetCore.Sockets.Tests.Internal.Formatters
} }
[Theory] [Theory]
[InlineData(0, 8, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, "")] [InlineData(0, 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, 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(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, 8, new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, "")] [InlineData(4, 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, byte[] encoded, string payload)
public void WriteTextMessage(int offset, int chunkSize, byte[] encoded, string payload)
{ {
var message = Encoding.UTF8.GetBytes(payload); var message = Encoding.UTF8.GetBytes(payload);
var output = new MemoryStream(); var output = new MemoryStream();

View File

@ -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] [Theory]
[MemberData(nameof(TransportTypesAndTransferModes))] [MemberData(nameof(TransportTypesAndTransferModes))]
public async Task ConnectionCanSendAndReceiveMessages(TransportType transportType, TransferMode requestedTransferMode) public async Task ConnectionCanSendAndReceiveMessages(TransportType transportType, TransferMode requestedTransferMode)
#pragma warning restore xUnit1026
{ {
using (StartLog(out var loggerFactory, testName: $"ConnectionCanSendAndReceiveMessages_{transportType.ToString()}")) using (StartLog(out var loggerFactory, testName: $"ConnectionCanSendAndReceiveMessages_{transportType.ToString()}"))
{ {

View File

@ -499,7 +499,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests
{ {
var invocation = Assert.IsType<InvocationMessage>(result); var invocation = Assert.IsType<InvocationMessage>(result);
Assert.Equal("Broadcast", invocation.Target); Assert.Equal("Broadcast", invocation.Target);
Assert.Equal(1, invocation.Arguments.Length); Assert.Single(invocation.Arguments);
Assert.Equal("test", invocation.Arguments[0]); Assert.Equal("test", invocation.Arguments[0]);
} }
@ -587,7 +587,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests
var hubMessage = await secondClient.ReadAsync().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.Single(invocation.Arguments);
Assert.Equal("test", invocation.Arguments[0]); Assert.Equal("test", invocation.Arguments[0]);
// kill the connections // kill the connections
@ -640,7 +640,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests
var hubMessage = await secondClient.ReadAsync().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.Single(invocation.Arguments);
Assert.Equal("test", invocation.Arguments[0]); Assert.Equal("test", invocation.Arguments[0]);
// kill the connections // kill the connections
@ -673,7 +673,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests
var hubMessage = await secondClient.ReadAsync().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.Single(invocation.Arguments);
Assert.Equal("test", invocation.Arguments[0]); Assert.Equal("test", invocation.Arguments[0]);
// kill the connections // kill the connections
@ -705,7 +705,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests
var hubMessage = await secondClient.ReadAsync().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.Single(invocation.Arguments);
Assert.Equal("test", invocation.Arguments[0]); Assert.Equal("test", invocation.Arguments[0]);
// kill the connections // kill the connections