public async Task <ActionResult <Patient> > PostPatient(PostPatientCommand command) { var result = await _mediator.Send(command); return(result != null ? (ActionResult)Ok(result) : NotFound()); //await _repository.CreateAsync<Patient>(patient); //return CreatedAtAction("GetPatient", new { id = patient.Id }, patient); }
public async Task PostPatient() { var repo = new Mock <IMediator>().Object; PostPatientCommand commad = new PostPatientCommand() { Id = 0, FirstName = "Jason", MiddleName = "Brace", LastName = "Palisoc", ContactNo = "09662679535", Birthday = new DateTime(), Sex = 'M' }; var result = await _controller.PostPatient(commad); Assert.IsType <OkResult>(result.Result); }