Cohesive granular materials may exhibit a much wider variety of microstructures than cohesionless ones, as adhesive forces may stabilize loose particle arrangements spanned by tenuous contact networks. We use DEM-type numerical simulations to explore two important aspects of the mechanical behaviour of these materials: isotropic or oedometric compression, in which the growing applied stress gradually overcomes the tensile strengths in contacts and causes the irreversible collapse of initially loose networks; and the critical states and inertial flows in steady, homogeneous shear, under controlled normal stress. A simple model of capillary cohesion for wet beads in the pendular regime lends itself to quantitative comparisons with laboratory experiments in both cases. A reduced pressure P* is defined, comparing the applied stress to the tensile strength of contacts, and shown to control the transition between loose, tenuous systems akin to colloidal aggregates and much denser cohesionless granular assemblies. A linear variation of void index with log P* is observed in compression within some intermediate P* range, in agreement with classical phenomenology in soil mechanics and other fields, and this behaviour is shown to be strongly influenced by the initial structure. Depending on the assembling procedure, this latter is characterized by coordination numbers and distribution of pore sizes, which significantly vary for the same particle solid fraction. Steady uniform shear flows are hardly observable for small P*, due to strong localization effets. For P* of order 1 or a few units, constitutive laws may be formulated that generalize the frictional or viscoplastic laws of cohesionless materials, as expressed with inertial number I (a reduced strain rate), to P*-dependent similar forms, involving both I and P*. In the quasistatic limit a macroscopic cohesion, in the sense of the Mohr-Coulomb criterion, may be identified for not too small P^*, and the enhanced shear resistance due to cohesion may be estimated via an "effective stress" assumption which, although not exact, proves quite efficient. The newt perspective is the P*-dependent gradual evolution of the microstructure from initial compression to steady shear flow.