From 46aa89be83568ef8e504d09de7c3e1374c77bbda Mon Sep 17 00:00:00 2001 From: sacOO7 Date: Fri, 8 Sep 2023 16:25:56 +0530 Subject: [PATCH] Refactored presence internal map test for checking internal members --- src/IO.Ably.Tests.Shared/Realtime/PresenceSandboxSpecs.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/IO.Ably.Tests.Shared/Realtime/PresenceSandboxSpecs.cs b/src/IO.Ably.Tests.Shared/Realtime/PresenceSandboxSpecs.cs index 2164856b1..13152afba 100644 --- a/src/IO.Ably.Tests.Shared/Realtime/PresenceSandboxSpecs.cs +++ b/src/IO.Ably.Tests.Shared/Realtime/PresenceSandboxSpecs.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; -using System.Threading; using System.Threading.Tasks; using IO.Ably.Realtime; @@ -423,7 +422,7 @@ async Task WaitForNoPresenceOnChannel(IRestChannel rChannel) [Theory] [ProtocolData] [Trait("spec", "RTP17f")] - public async Task OnResumedAttach_ShouldReEnterMembersFromInternalMap(Protocol protocol) + public async Task OnAttach_ShouldEnterMembersFromInternalMap(Protocol protocol) { var channelName = "RTP17c2".AddRandomSuffix(); var setupClient = await GetRealtimeClient(protocol); @@ -536,7 +535,6 @@ public async Task Presence_ShouldHaveInternalMapForCurrentConnectionId(Protocol channelB.State.Should().Be(ChannelState.Attaching); await channelB.WaitForAttachedState(); channelB.State.Should().Be(ChannelState.Attached); - // ENTER PresenceMessage msgA = null, msgB = null; await WaitForMultiple(2, partialDone => @@ -544,12 +542,14 @@ await WaitForMultiple(2, partialDone => channelA.Presence.Subscribe(msg => { msgA = msg; + channelA.Presence.Unsubscribe(); partialDone(); }); channelB.Presence.Subscribe(msg => { msgB = msg; + channelB.Presence.Unsubscribe(); partialDone(); });