-
Notifications
You must be signed in to change notification settings - Fork 446
Conversation
Fix ignoring empty string on CloseMessage
Outstanding are a couple of tests with the |
@@ -1686,15 +1688,16 @@ public static IEnumerable<object[]> StreamingMethodAndHubProtocols | |||
{ | |||
get | |||
{ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super nit: extra space.
Nope, thats odd. |
Creating an almost identical enum and using that instead fixed it 😕 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No more warnings and proper listing of Theories in Test Explorer/Resharper? I'm in for sure.
public enum TestWebSocketMessageType | ||
{ | ||
Binary = 1, | ||
Text = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth filing a bug, but I don't know exactly where it would go. I think maybe it's xunit here? WebSocketMessageType
doesn't look any different from this enum really: https://source.dot.net/#System.Net.WebSockets/System/Net/WebSockets/WebSocketMessageType.cs,17aa513fb8c7e9fc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like it's a problem on desktop framework when the enum is in the GAC. https://twitter.com/anurse/status/980825964757176320
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And not just enums, anything from the GAC (that we don't already special case): https://github.com/xunit/xunit/blob/4d2679934462bc2bc459f340d8bcfce624ce1512/test/test.xunit.execution/Common/XunitSerializationInfoTests.cs#L233-L245
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another reason to hate the GAC
@@ -254,5 +269,25 @@ private static byte[] FormatMessageToArray(byte[] message) | |||
TextMessageFormatter.WriteRecordSeparator(output); | |||
return output.ToArray(); | |||
} | |||
|
|||
public class ProtocolTestData1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ProtocolTestData1?
[InlineData(WebSocketMessageType.Binary)] | ||
public async Task ReceivedFramesAreWrittenToChannel(WebSocketMessageType webSocketMessageType) | ||
[InlineData(TestWebSocketMessageType.Text)] | ||
[InlineData(TestWebSocketMessageType.Binary)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I suggested on Twitter, I believe we convert string data into enum values. I don't know if nameof
supports enum values (to help preserve values across renames), but given your work-around, you've already given up on rename refactor support anyway...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nameof
should work here actually, so we could try that.
Did auto-conversion from string test data to Enum parameter not work correctly? |
- avoid "Skipping test case with duplicate ID" messages - xUnit gets confused when `[Theory]`s are overridden - avoid "falling back to single test case" messages - fix inspired by aspnet/SignalR#1820
- avoid "Skipping test case with duplicate ID" messages - xUnit gets confused when `[Theory]`s are overridden - avoid "falling back to single test case" messages - fix inspired by aspnet/SignalR#1820
- avoid "Skipping test case with duplicate ID" messages - xUnit gets confused when `[Theory]`s are overridden - avoid "falling back to single test case" messages - fix inspired by aspnet/SignalR#1820
Also fix ignoring empty string on CloseMessage
#1649