  Galaxy formation and evolution simulations are essential tools to probe
poorly known astrophysics processes, but particular care is needed to compare
simulations with galaxy observations, as observed data need to be modelled as
well. We present a method to generate mock galaxies from the hydro-dynamical
IllustrisTNG simulations which are suited to compare with integral field
spectroscopic observation of galaxies from the SDSS-IV/MaNGA survey. Firstly,
we include the same instrumental effects and procedures as adopted in the
acquisition and analysis of real data. Furthermore, we generate the galaxy
spectra from the simulations using new stellar population models based on the
MaNGA stellar library (MaStar). In this way, our mock data cubes have the same
spatial sampling, cover the same wavelength range (3600-10300 \r{A}), and share
the same spectral resolution ($R\approx1800$) and flux calibration of real
MaNGA galaxy spectra. In this first paper, we demonstrate the method over an
early-type and a late-type simulated galaxy from TNG50. We analyse the
correspondent mock MaNGA-like data cubes with the same full spectral fitting
code, \textsc{FIREFLY}, which was used for the observed spectra. We find that
the intrinsic and recovered age and metallicity gradients are consistent within
1${\sigma}$, with residuals over all tassels consistent with $0$ at the 68$\%$
confidence level. We also perform the challenging test at comparing intrinsic
and recovered star formation histories, finding a close resemblance between
input and output. In follow-up papers, we will present a full simulated
MaNGA-like catalogue ($\approx10,000$ galaxies) with a comprehensive comparison
of TNG50 simulations to MaNGA observational results.
