コード例 #1
0
        public void Delete_DeveChamarRepository()
        {
            var id = Guid.NewGuid();

            _service.Delete(id);

            _repositoryMock.Verify(x => x.Delete(id), Times.Once);
        }
コード例 #2
0
        public void Contato_Remover_RemoveContato()
        {
            var guid = Guid.NewGuid();

            _contatoService.Delete(guid);

            _contatoRepositoryMock.Verify(x => x.Delete(guid), Times.Once);
        }
コード例 #3
0
 public ActionResult Delete(Contato contato)
 {
     try
     {
         var contatoService = new ContatoService();
         contatoService.Delete(contato);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }