public ActionResult Excluir(int id) { using (var repo = new AssuntoRepository()) { var assunto = repo.Obter(id); return(View(assunto)); } }
private void Excluir(AssuntoCursoUsuario assunto) { using (AssuntoRepository repo = new AssuntoRepository()) { repo.Excluir(assunto); var assuntoRet = repo.Obter(assunto.IdAssunto); Assert.IsTrue(assuntoRet == null); } }
public AssuntoCursoUsuario ObterAssunto(int id) { using (AssuntoRepository repo = new AssuntoRepository()) { var assunto = repo.Obter(id); Assert.AreEqual("Demo teste 1", assunto.Nome); return(assunto); } }
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); } }