Skip to content

Commit

Permalink
Updated connectionSpecs, setting messageserial to 45
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Sep 7, 2023
1 parent c0daf2e commit ae75505
Showing 1 changed file with 5 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using FluentAssertions;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
Expand All @@ -18,28 +15,18 @@ public async Task RecoveryKey_MsgSerialShouldNotBeSentToAblyButShouldBeSetOnConn
{
var recoveryKey =
"{\"connectionKey\":\"uniqueKey\",\"msgSerial\":45,\"channelSerials\":{\"channel1\":\"1\",\"channel2\":\"2\",\"channel3\":\"3\"}}";
FakeTransportFactory.InitialiseFakeTransport =
transport => transport.OnConnectChangeStateToConnected = false;
var client = GetClientWithFakeTransport(options => { options.Recover = recoveryKey; });

await Task.Delay(9000);
client.Connection.MessageSerial.Should().Be(45);

var transportParams = await client.ConnectionManager.CreateTransportParameters("https://realtime.ably.io");
var paramsDict = transportParams.GetParams();
paramsDict.ContainsKey("recover").Should().BeTrue();
paramsDict["recover"].Should().Be("uniqueKey");
paramsDict.ContainsKey("msg_serial").Should().BeFalse();

async Task WaitFor(Action<Action> done)
{
await TestHelpers.WaitFor(10000, 1, done);
}

await WaitFor(done =>
{
if (client.Connection.MessageSerial == 45)
{
done();
}
});

// client.Connection.MessageSerial.Should().Be(45); // assertion fails on CI
}

public ConnectionSpecs(ITestOutputHelper output)
Expand Down

0 comments on commit ae75505

Please sign in to comment.