refactor(battle-node): SocketIoFrame throws on namespace; typed JSON construction
This commit is contained in:
@@ -105,6 +105,16 @@ public class SocketIoFrameTests
|
||||
Assert.That(text, Is.EqualTo(wire));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Parse_NamespacePrefix_Throws()
|
||||
{
|
||||
// v1 only supports the default namespace. A "/foo," prefix used to be silently
|
||||
// skipped, which would route a frame meant for namespace /foo to the default
|
||||
// handler. Fail loud instead so we'd notice if the client ever started using one.
|
||||
var ex = Assert.Throws<ArgumentException>(() => SocketIoFrame.Parse("2/foo,[\"msg\"]"));
|
||||
Assert.That(ex!.Message, Does.Contain("/foo"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Encode_EventNameWithSpecialChars_IsJsonEscaped()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user