Skip to content

Commit

Permalink
Moved recovery spec test under connectionRecoverySpec
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Sep 16, 2023
1 parent 61dc64f commit 116d6e2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 38 deletions.
1 change: 0 additions & 1 deletion src/IO.Ably.Tests.Shared/IO.Ably.Tests.Shared.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@
<Compile Include="$(MSBuildThisFileDirectory)Realtime\ConnectionSpecs\ConnectionParameterSpecs.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Realtime\ConnectionSpecs\ConnectionPingSpecs.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Realtime\ConnectionSpecs\ConnectionRecoverySpecs.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Realtime\ConnectionSpecs\ConnectionSpecs.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Realtime\ConnectionSpecs\EventEmitterSpecs.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Realtime\ConnectionSpecs\GeneralConnectionSpecs.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Realtime\ConnectionStateTests\ClosedStateSpecs.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,27 @@ public async Task DeprecatedRecoveryKeyProperty_ShouldBehaveSameAsCreateRecovery
client.Connection.RecoveryKey.Should().Be(expectedRecoveryKey);
}

[Fact]
[Trait("spec", "RTN16i")]
[Trait("spec", "RTN16f")]
[Trait("spec", "RTN16j")]
public async Task RecoveryKey_MsgSerialShouldNotBeSentToAblyButShouldBeSetOnConnection()
{
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; });

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();
await Task.Delay(2000);
client.Connection.MessageSerial.Should().Be(45);
}

public ConnectionRecoverySpecs(ITestOutputHelper output)
: base(output)
{
Expand Down

This file was deleted.

0 comments on commit 116d6e2

Please sign in to comment.