From 3daa53f8d7a5ce6cdbd0ab5d2ce113ba4d1a840b Mon Sep 17 00:00:00 2001 From: Mohit Tejani Date: Sat, 30 Nov 2024 08:23:11 +0530 Subject: [PATCH] fix test implementation of with wildcard channel subscription, updated chancel method of EmitMessages effect --- .../EventEngine/Subscribe/Effects/EmitMessagesHandler.cs | 6 ++---- .../PubnubApi.Tests/WhenSubscribedToWildcardChannel.cs | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Api/PubnubApi/EventEngine/Subscribe/Effects/EmitMessagesHandler.cs b/src/Api/PubnubApi/EventEngine/Subscribe/Effects/EmitMessagesHandler.cs index 38a821089..02fa245fa 100644 --- a/src/Api/PubnubApi/EventEngine/Subscribe/Effects/EmitMessagesHandler.cs +++ b/src/Api/PubnubApi/EventEngine/Subscribe/Effects/EmitMessagesHandler.cs @@ -79,9 +79,7 @@ private object DeserializePayload(string key, object rawMessage) public override bool IsBackground(EmitMessagesInvocation invocation) => false; - public override Task Cancel() - { - throw new NotImplementedException(); - } + public override Task Cancel() => Task.CompletedTask; + } } \ No newline at end of file diff --git a/src/UnitTests/PubnubApi.Tests/WhenSubscribedToWildcardChannel.cs b/src/UnitTests/PubnubApi.Tests/WhenSubscribedToWildcardChannel.cs index 49d5915f6..679308cf8 100644 --- a/src/UnitTests/PubnubApi.Tests/WhenSubscribedToWildcardChannel.cs +++ b/src/UnitTests/PubnubApi.Tests/WhenSubscribedToWildcardChannel.cs @@ -1094,7 +1094,7 @@ public static void ThenSubscribeShouldReturnWildCardPresenceEventInWildcardPrese bool receivedMessage = false; bool receivedErrorMessage = true; - PNConfiguration config = new PNConfiguration(new UserId("mytestuuid")) + PNConfiguration config = new PNConfiguration(new UserId($"user{new Random().Next(10,100)}")) { PublishKey = PubnubCommon.PublishKey, SubscribeKey = PubnubCommon.SubscribeKey,