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>(); }