public void DeleteVenueShouldCallRepository() { const int venueId = 1; m_VenueRepositoryMock = new Mock<IVenueRepository>(); m_VenueService = new VenueService(m_VenueRepositoryMock.Object); m_VenueService.DeleteVenue(venueId); m_VenueRepositoryMock.Verify(x => x.Delete(venueId), Times.Once); }
public async Task <ActionResult <string> > DeleteVenue(Guid id) { BaseResponseDto <VenueDto> delVenue = await _venueService.DeleteVenue(id); if (!delVenue.HasError) { return(Ok(delVenue.Data)); } else { return(BadRequest(delVenue.Errors)); } }
public async Task <IActionResult> Delete(long Id) { try { if (!ModelState.IsValid) { return(BadRequest(GetModelStateErrors(ModelState))); } var response = await _venueService.DeleteVenue(Id); if (response.ResponseCode != ResponseCode.Ok) { return(Ok(WebApiResponses <object> .ErrorOccured(response.Message))); } return(Ok(WebApiResponses <object> .Successful(response.ResponseData))); } catch (Exception ex) { Log.Error(ex); return(Ok(WebApiResponses <object> .ErrorOccured(ex.Message))); } }
public async Task <VenueViewModel> DeleteVenue([FromBody] VenueViewModel venue) { return(await _venueService.DeleteVenue(venue.Id)); }
public bool Execute() { return(_service.DeleteVenue(_command.Venue)); }
public ActionResult Delete(int id) { _venueService.DeleteVenue(id); return(RedirectToAction("Index")); }
public void DeleteVenue_InputIdIsEmpty_Throw() { Assert.Throws <NullReferenceException>(() => srv.DeleteVenue(Guid.Empty)); }