public ActionResult Excluir(int id)
        {
            using (var repo = new AssuntoRepository())
            {
                var assunto = repo.Obter(id);

                return(View(assunto));
            }
        }
예제 #2
0
 private void Excluir(AssuntoCursoUsuario assunto)
 {
     using (AssuntoRepository repo = new AssuntoRepository())
     {
         repo.Excluir(assunto);
         var assuntoRet = repo.Obter(assunto.IdAssunto);
         Assert.IsTrue(assuntoRet == null);
     }
 }
예제 #3
0
        public AssuntoCursoUsuario ObterAssunto(int id)
        {
            using (AssuntoRepository repo = new AssuntoRepository())
            {
                var assunto = repo.Obter(id);

                Assert.AreEqual("Demo teste 1", assunto.Nome);

                return(assunto);
            }
        }
예제 #4
0
        private AssuntoCursoUsuario AtualizarAssunto(AssuntoCursoUsuario assunto)
        {
            using (AssuntoRepository repo = new AssuntoRepository())
            {
                assunto.Nome = "Nome Atualizado";
                repo.Atualizar(assunto);

                var assuntoAtualizado = repo.Obter(assunto.IdAssunto);

                Assert.AreEqual("Nome Atualizado", assuntoAtualizado.NomeAssunto);

                return(assuntoAtualizado);
            }
        }