public void GetConnectionAsync_should_get_connection_from_server() { var subject = new ServerConnectionSource(_server); subject.GetConnectionAsync(Timeout.InfiniteTimeSpan, CancellationToken.None); _server.Received().GetConnectionAsync(Timeout.InfiniteTimeSpan, CancellationToken.None); }
public void GetConnectionAsync_should_get_connection_from_server() { var subject = new ServerConnectionSource(_server); subject.GetConnectionAsync(Timeout.InfiniteTimeSpan, CancellationToken.None); _server.Received().GetConnectionAsync(Timeout.InfiniteTimeSpan, CancellationToken.None); }
public void GetConnectionAsync_should_throw_if_disposed() { var subject = new ServerConnectionSource(_server); subject.Dispose(); Action act = () => subject.GetConnectionAsync(Timeout.InfiniteTimeSpan, CancellationToken.None); act.ShouldThrow<ObjectDisposedException>(); }
public void GetConnectionAsync_should_throw_if_disposed() { var subject = new ServerConnectionSource(_server); subject.Dispose(); Action act = () => subject.GetConnectionAsync(Timeout.InfiniteTimeSpan, CancellationToken.None); act.ShouldThrow <ObjectDisposedException>(); }
public void ServerDescription_should_return_description_of_server() { var subject = new ServerConnectionSource(_server); var desc = ServerDescriptionHelper.Disconnected(new ClusterId()); _server.Description.Returns(desc); var result = subject.ServerDescription; result.Should().BeSameAs(desc); }
public void ServerDescription_should_return_description_of_server() { var subject = new ServerConnectionSource(_server); var desc = ServerDescriptionHelper.Disconnected(new ClusterId()); _server.Description.Returns(desc); var result = subject.ServerDescription; result.Should().BeSameAs(desc); }