@@ -43,7 +43,7 @@ public WebSocketCloseTests()
43
43
public void WebSocketReceiveResult_WebSocketCloseStatus_Roundtrip ( WebSocketCloseStatus closeStatus )
44
44
{
45
45
string closeStatusDescription = "closeStatus " + closeStatus . ToString ( ) ;
46
- WebSocketReceiveResult wsrr = new WebSocketReceiveResult ( 42 , WebSocketMessageType . Close , true , closeStatus , closeStatusDescription ) ;
46
+ WebSocketReceiveResult wsrr = new WebSocketReceiveResult ( 42 , WebSocketMessageType . Close , endOfMessage : true , closeStatus , closeStatusDescription ) ;
47
47
Assert . Equal ( 42 , wsrr . Count ) ;
48
48
Assert . Equal ( closeStatus , wsrr . CloseStatus ) ;
49
49
Assert . Equal ( closeStatusDescription , wsrr . CloseStatusDescription ) ;
@@ -57,16 +57,16 @@ public async Task ReceiveAsync_ValidCloseStatus_Success(WebSocketCloseStatus clo
57
57
WebSocketTestStream stream = new ( ) ;
58
58
Encoding encoding = Encoding . UTF8 ;
59
59
60
- using ( WebSocket server = WebSocket . CreateFromStream ( stream , isServer : true , null , TimeSpan . FromSeconds ( 3 ) ) )
61
- using ( WebSocket client = WebSocket . CreateFromStream ( stream . Remote , isServer : false , null , TimeSpan . FromSeconds ( 3 ) ) )
60
+ using ( WebSocket server = WebSocket . CreateFromStream ( stream , isServer : true , subProtocol : null , TimeSpan . FromSeconds ( 3 ) ) )
61
+ using ( WebSocket client = WebSocket . CreateFromStream ( stream . Remote , isServer : false , subProtocol : null , TimeSpan . FromSeconds ( 3 ) ) )
62
62
{
63
63
Assert . NotNull ( server ) ;
64
64
Assert . NotNull ( client ) ;
65
65
66
66
// send something
67
67
string hello = "Testing " + closeStatus . ToString ( ) ;
68
68
byte [ ] sendBytes = encoding . GetBytes ( hello ) ;
69
- await server . SendAsync ( sendBytes . AsMemory ( ) , WebSocketMessageType . Text , WebSocketMessageFlags . DisableCompression , CancellationToken ) ;
69
+ await server . SendAsync ( sendBytes . AsMemory ( ) , WebSocketMessageType . Text , WebSocketMessageFlags . None , CancellationToken ) ;
70
70
71
71
// and then server-side close with the test status
72
72
string closeStatusDescription = "CloseStatus " + closeStatus . ToString ( ) ;
@@ -82,7 +82,7 @@ public async Task ReceiveAsync_ValidCloseStatus_Success(WebSocketCloseStatus clo
82
82
WebSocketReceiveResult closing = await client . ReceiveAsync ( new ArraySegment < byte > ( receiveBuffer ) , CancellationToken ) ;
83
83
Assert . Equal ( WebSocketMessageType . Close , closing . MessageType ) ;
84
84
Assert . Equal ( closeStatus , closing . CloseStatus ) ;
85
- Assert . Equal ( serverMessage , closing . CloseStatusDescription ) ;
85
+ Assert . Equal ( closeStatusDescription , closing . CloseStatusDescription ) ;
86
86
}
87
87
}
88
88
}
0 commit comments