diff --git a/lib/src/realm.dart b/lib/src/realm.dart index 0403c83..7e4d619 100644 --- a/lib/src/realm.dart +++ b/lib/src/realm.dart @@ -36,7 +36,7 @@ class Realm { case Call.id: case Yield.id: case Register.id: - case UnRegister.id: + case Unregister.id: MessageWithRecipient recipient = _dealer.receiveMessage(sessionID, msg); var client = _clients[recipient.recipient]; client?.sendMessage(recipient.message); @@ -63,7 +63,7 @@ class Realm { break; case Subscribe.id: - case UnSubscribe.id: + case Unsubscribe.id: MessageWithRecipient? recipient = _broker.receiveMessage(sessionID, msg); if (recipient == null) { throw Exception("recipient null"); diff --git a/lib/src/session.dart b/lib/src/session.dart index 5de1a28..7f31a4d 100644 --- a/lib/src/session.dart +++ b/lib/src/session.dart @@ -68,7 +68,7 @@ class Session { ); _baseSession.send(data); } - } else if (message is msg.UnRegistered) { + } else if (message is msg.Unregistered) { var request = _unregisterRequests.remove(message.requestID); if (request != null) { _registrations.remove(request.registrationID); @@ -90,7 +90,7 @@ class Session { if (endpoint != null) { endpoint(Event(args: message.args, kwargs: message.kwargs, details: message.details)); } - } else if (message is msg.UnSubscribed) { + } else if (message is msg.Unsubscribed) { var request = _unsubscribeRequests.remove(message.requestID); if (request != null) { _subscriptions.remove(request.subscriptionId); @@ -112,7 +112,7 @@ class Session { ); break; - case msg.UnRegister.id: + case msg.Unregister.id: var unregisterRequest = _unregisterRequests.remove(message.requestID); unregisterRequest?.future.completeError( ApplicationError(message.uri, args: message.args, kwargs: message.kwargs), @@ -126,7 +126,7 @@ class Session { ); break; - case msg.UnSubscribe.id: + case msg.Unsubscribe.id: var unsubscribeRequest = _unsubscribeRequests.remove(message.requestID); unsubscribeRequest?.future.completeError( ApplicationError(message.uri, args: message.args, kwargs: message.kwargs), @@ -182,7 +182,7 @@ class Session { } Future unregister(Registration reg) { - var unregister = msg.UnRegister(_nextID, reg.registrationID); + var unregister = msg.Unregister(_nextID, reg.registrationID); var completer = Completer(); _unregisterRequests[unregister.requestID] = UnregisterRequest(completer, reg.registrationID); @@ -223,7 +223,7 @@ class Session { } Future unsubscribe(Subscription sub) { - var unsubscribe = msg.UnSubscribe(_nextID, sub.subscriptionID); + var unsubscribe = msg.Unsubscribe(_nextID, sub.subscriptionID); var completer = Completer(); _unsubscribeRequests[unsubscribe.requestID] = UnsubscribeRequest(completer, sub.subscriptionID); diff --git a/test/router_test.dart b/test/router_test.dart index 082e45e..b362a67 100644 --- a/test/router_test.dart +++ b/test/router_test.dart @@ -44,11 +44,11 @@ void main() { }); test("unregister", () async { - var unregisterMsg = msg.UnRegister(5, registrationID); + var unregisterMsg = msg.Unregister(5, registrationID); await router.receiveMessage(clientSideBase, unregisterMsg); var unregistered = await clientSideBase.receiveMessage(); - expect(unregistered, isA()); + expect(unregistered, isA()); }); late int subscriptionID; @@ -81,10 +81,10 @@ void main() { }); test("unsubscribe", () async { - var unsubscribeMsg = msg.UnSubscribe(9, subscriptionID); + var unsubscribeMsg = msg.Unsubscribe(9, subscriptionID); await router.receiveMessage(clientSideBase, unsubscribeMsg); var unsubscribed = await clientSideBase.receiveMessage(); - expect(unsubscribed, isA()); + expect(unsubscribed, isA()); }); }