Exemple #1
0
        public async Task E_Possivel_Excutar_Delete()
        {
            _serviceMock = new Mock <IFilmeServices>();
            _serviceMock.Setup(m => m.Delete(IdFilmes))
            .ReturnsAsync(true);
            _service = _serviceMock.Object;

            var deletado = await _service.Delete(IdFilmes);

            Assert.True(deletado);
        }
Exemple #2
0
 public async Task <ActionResult> Delete(int id)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest(ModelState)); //400 solicitação invalida
     }
     try
     {
         return(Ok(await _service.Delete(id)));
     }
     catch (ArgumentException e)
     {
         return(StatusCode((int)HttpStatusCode.InternalServerError, e.Message));
     }
 }