  The observation of binary neutron star merger GW170817, along with its
optical counterpart, provided the first constraint on the Hubble constant $H_0$
using gravitational wave standard sirens. When no counterpart is identified, a
galaxy catalog can be used to provide the necessary redshift information.
However, the true host might not be contained in a catalog which is not
complete out to the limit of gravitational-wave detectability. These
electromagnetic and gravitational-wave selection effects must be accounted for.
We describe and implement a method to estimate $H_0$ using both the counterpart
and the galaxy catalog standard siren methods. We perform a series of mock data
analyses using binary neutron star mergers to confirm our ability to recover an
unbiased estimate of $H_0$. Our simulations used a simplified universe with no
redshift uncertainties or galaxy clustering, but with different
magnitude-limited catalogs and assumed host galaxy properties, to test our
treatment of both selection effects. We explore how the incompleteness of
catalogs affects the final measurement of $H_0$, as well as the effect of
weighting each galaxy's likelihood of being a host by its luminosity. In our
most realistic simulation, where the simulated catalog is about three times
denser than the density of galaxies in the local universe, we find that a 4.4\%
measurement precision can be reached using galaxy catalogs with 50\%
completeness and $\sim 250$ binary neutron star detections with sensitivity
similar to that of Advanced LIGO's second observing run.
