Skip to content

Commit

Permalink
Added test to fix realtimeworkflow queue messages
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Apr 26, 2023
1 parent 4826de7 commit 43b8d14
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/IO.Ably.Tests.Shared/Realtime/PresenceSandboxSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1649,6 +1649,32 @@ public async Task ChannelStateCondition_WhenQueueMessagesIsFalse_WhenChannelIsIn
client.Close();
}

[Theory]
[ProtocolData]
[Trait("spec", "RTP16b")]
public async Task ChannelStateCondition_WhenQueueMessagesIsFalse_RealtimeWorkflowQueueShouldntAllowMessagesToPublish(Protocol protocol)
{
var client = await GetRealtimeClient(protocol, (options, settings) =>
{
options.ClientId = "RTP16b";
options.QueueMessages = false;
});
var channel = GetRandomChannel(client, "RTP16a");

await client.WaitForState(ConnectionState.Connected);
client.Workflow.QueueCommand(SetDisconnectedStateCommand.Create(null));
await client.WaitForState(ConnectionState.Disconnected);

channel.Presence.Enter(client.Connection.State.ToString(), (b, info) => { });

Presence.QueuedPresenceMessage[] presenceMessages = channel.Presence.PendingPresenceQueue.ToArray();

presenceMessages.Should().HaveCount(0);

// clean up
client.Close();
}

[Theory]
[ProtocolData]
[Trait("spec", "RTP16b")]
Expand Down

0 comments on commit 43b8d14

Please sign in to comment.