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);
        }
Exemplo n.º 2
0
        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));
            }
        }
Exemplo n.º 3
0
        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));
 }
Exemplo n.º 6
0
 public ActionResult Delete(int id)
 {
     _venueService.DeleteVenue(id);
     return(RedirectToAction("Index"));
 }
Exemplo n.º 7
0
 public void DeleteVenue_InputIdIsEmpty_Throw()
 {
     Assert.Throws <NullReferenceException>(() => srv.DeleteVenue(Guid.Empty));
 }