Example #1
0
        public ActionResult Edit(int id, OrcamentoViewModel orcamentoViewModel)
        {
            try
            {
                var orcamento = Mapeador.Mapear <OrcamentoViewModel, Orcamento>(orcamentoViewModel);
                _gerenciadorDeOrcamento.Editar(orcamento);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Example #2
0
        // POST: Edit
        public HttpResponseMessage Put(Orcamento orcamento)
        {
            HttpResponseMessage response;

            try
            {
                _gerenciadorDeOrcamento.Editar(orcamento);

                response = Request.CreateResponse(HttpStatusCode.OK, orcamento);
            }
            catch (Exception ex)
            {
                response = Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex);
            }

            return(response);
        }
 public void Editar()
 {
     _orcamentoServiceMock.Setup(x => x.Edit(It.IsAny <Orcamento>()));
     _orcamentoServiceMock.Setup(x => x.Save());
     Assert.IsNotNull(_gerenciadorDeOrcamento.Editar(OrcamentoStub.Despesa()));
 }