public async Task <ActionResult> Delete(int id) { var deleteApplicantCommand = new DeleteApplicantCommand() { Id = id }; await _mediator.Send(deleteApplicantCommand); return(NoContent()); }
public async Task Handle_GivenInValidRequestId_ShouldThrowNotFoundException() { // Arrange var sut = new DeleteApplicantCommandQueryHandler(_context); var id = 100; var request = new DeleteApplicantCommand { ID = id }; // Assert await Assert.ThrowsAsync <NotFoundException>(() => sut.Handle(request, CancellationToken.None)); }
public async Task <bool> Delete(int applicantId) { DeleteApplicantCommand command = new DeleteApplicantCommand(applicantId); return(await _mediator.Send(command)); }