Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ public void ConnectShouldActivateKeepAliveIfSessionIs()

_client.Connect();

// allow keep-alive to be sent twice
Thread.Sleep(250);
// allow keep-alive to be sent at least twice with some margin for error
Thread.Sleep(5 * (int)_keepAliveInterval.TotalMilliseconds);

// Exactly two keep-alives should be sent
SessionMock.Verify(p => p.TrySendMessage(It.IsAny<IgnoreMessage>()), Times.Exactly(2));
// At least two keep-alives should be sent
SessionMock.Verify(p => p.TrySendMessage(It.IsAny<IgnoreMessage>()), Times.AtLeast(2));
}

private class MyClient : BaseClient
Expand Down