예제 #1
0
        public void InserirRegistroValido(int contador, string descricao)
        {
            var resultado = appService.Inserir(new MarcaViewModel()
            {
                Descricao = descricao
            });

            Assert.True(resultado.Successo);
            Assert.Equal(Textos.Geral_Mensagem_Sucesso_Inclusao, resultado.Mensagem);

            var parametros = appService.RecuperarTodos().Data;

            Assert.Equal(contador, parametros.Count);
        }
예제 #2
0
        public ActionResult Cadastrar(MarcaViewModel model)
        {
            var resultado = service.Inserir(model);

            if (resultado.Successo)
            {
                resultado.RedirecionarPara(Url.Action(nameof(Index)));
            }

            return(Json(resultado.Retorno()));
        }