public void CrearCurso(CrearMatriculaRequest request, string expected) { _service = new CrearMatriculaService(_unitOfWork); var response = _service.Ejecutar(request); Assert.AreEqual(expected, response.Message); }
public async Task <IActionResult> CreateMatricula([FromBody] int idPreMatricula) { _service = new CrearMatriculaService(_unitOfWork); request = new CrearMatriculaRequest(); request.IdPreMatricula = idPreMatricula; var rta = _service.Ejecutar(request); if (rta.isOk()) { await _context.SaveChangesAsync(); return(CreatedAtAction("GetUsuario", new { IdPrematricula = request.IdPreMatricula }, request)); } return(BadRequest(rta.Message)); }