示例#1
0
        public void RemoverValidoTest()
        {
            GerenciadorPostagem gerenciadorPostagem = new GerenciadorPostagem();
            PostagemModel       postagemActual      = gerenciadorPostagem.Obter(4);

            gerenciadorPostagem.Remover(4);
            PostagemModel novaPostagem = gerenciadorPostagem.Obter(4);

            Assert.IsNull(novaPostagem);
        }
示例#2
0
        public void RemoverInvalidoTest()
        {
            GerenciadorPostagem gerenciadorPostagem = new GerenciadorPostagem();

            try
            {
                gerenciadorPostagem.Remover(1);
            }
            catch (Exception e)
            {
                Assert.IsInstanceOfType(e, typeof(ServiceException));
            }
            PostagemModel novaPostagem = gerenciadorPostagem.Obter(1);

            Assert.IsNotNull(novaPostagem);
        }
示例#3
0
 public ActionResult DeleteConfirmed(int id)
 {
     gPostagem.Remover(id);
     return(RedirectToAction("Index"));
 }