public ActionResult Create(ItemSubValorViewModel itemSubValorViewModel)
        {
            try
            {
                var itemSubValor = Mapeador.Mapear <ItemSubValorViewModel, ItemSubValor>(itemSubValorViewModel);
                _gerenciadorDeItemSubValor.Salvar(itemSubValor);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
        // POST: Create
        public HttpResponseMessage Post(ItemSubValor itemSubValor)
        {
            HttpResponseMessage response;

            try
            {
                _gerenciadorDeItemSubValor.Salvar(itemSubValor);

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

            return(response);
        }
 public void Salvar()
 {
     _itemSubValorServiceMock.Setup(x => x.Add(It.IsAny <ItemSubValor>())).Returns(ItemSubValorStub.NovoItemSubValor());
     _itemSubValorServiceMock.Setup(x => x.Save());
     Assert.IsTrue(_gerenciadorDeItemSubValor.Salvar(It.IsAny <ItemSubValor>()));
 }