public async Task ConnectingState_SendsHandleConnectionDisconnectedCommand() { // Act _state.StartTimer(); _timer.OnTimeOut(); // Assert _timer.StartedWithAction.Should().BeTrue(); _context.ShouldQueueCommand <HandleConnectingDisconnectedCommand>(); }
public async Task AfterTimeoutExpires_ShouldForceStateToClosed() { var state = GetState(connectedTransport: true); state.StartTimer(); _timer.StartedWithAction.Should().BeTrue(); _timer.OnTimeOut(); _context.ShouldQueueCommand <SetClosedStateCommand>(); }
public async Task ShouldRetryConnection() { _context.Transport = new FakeTransport(TransportState.Initialized); // Act _state.StartTimer(); _timer.StartedWithAction.Should().BeTrue(); _timer.OnTimeOut(); // Assert _context.ShouldQueueCommand <SetConnectingStateCommand>(); }
public async Task ShouldRetyConnection() { _context.Transport = new FakeTransport(TransportState.Initialized); // Act await _state.OnAttachToContext(); _timer.StartedWithAction.Should().BeTrue(); _timer.OnTimeOut(); // Assert _context.StateShouldBe <ConnectionConnectingState>(); }
public async Task ConnectingState_ForceDisconnect() { // Arrange _context.Transport = new FakeTransport() { State = TransportState.Initialized }; // Act await _state.OnAttachToContext(); _timer.OnTimeOut(); // Assert _timer.StartedWithAction.Should().BeTrue(); _context.HandledConnectionFailureCalled.Should().BeTrue(); }
public async Task AfterAnInterval_ShouldRetryConnection() { // Arrange var transport = new FakeTransport { State = TransportState.Initialized }; _context.Transport = transport; var state = GetState(ErrorInfo.ReasonClosed); // Act state.StartTimer(); _timer.OnTimeOut(); // Assert _timer.StartedWithAction.Should().BeTrue(); _context.ShouldQueueCommand <SetConnectingStateCommand>(); }
public async Task AfterAnInterval_ShouldRetryConnection() { // Arrange var transport = new FakeTransport() { State = TransportState.Initialized }; _context.Transport = transport; var state = GetState(ErrorInfo.ReasonClosed); // Act await state.OnAttachToContext(); _timer.OnTimeOut(); // Assert _timer.StartedWithAction.Should().BeTrue(); _context.StateShouldBe <ConnectionConnectingState>(); }