  To assume hydrostatic equilibrium between the intracluster medium and the
gravitational potential of galaxy clusters is an extensively used method to
investigate their total masses. We want to test hydrostatic masses obtained
with an observational code in the context of the SRG/eROSITA survey. We use the
hydrostatic modeling code MBProj2 to fit surface-brightness profiles to
simulated clusters with idealized properties as well as to a sample of 93
clusters taken from the Magneticum Pathfinder simulations. We investigate the
latter under the assumption of idealized observational conditions and also for
realistic eROSITA data quality. The comparison of the fitted cumulative total
mass profiles and the true mass profiles provided by the simulations allows to
gain knowledge about the reliability of our approach. Furthermore, we use the
true profiles for gas density and pressure to compute hydrostatic mass profiles
based on theory for every cluster. For an idealized cluster that was simulated
to fulfill perfect hydrostatic equilibrium, we find that the cumulative total
mass at the true $r_{500}$ and $r_{200}$ can be reproduced with deviations of
less than 7%. For the clusters from the Magneticum Pathfinder simulations under
idealized observational conditions, the median values of the fitted cumulative
total masses at the true $r_{500}$ and $r_{200}$ are in agreement with our
expectations, taking into account the hydrostatic mass bias. Nevertheless, we
find a tendency towards a too high steepness of the cumulative total mass
profiles in the outskirts. For realistic eROSITA data quality, this steepness
problem intensifies for clusters with high redshifts and thus leads to too high
cumulative total masses at $r_{200}$. For the hydrostatic masses based on the
true profiles known from the simulations, we find a good agreement with our
expectations concerning the hydrostatic mass.
