Exemplo n.º 1
0
        public ActionResult MinhasPostagens()
        {
            int idPessoa = gPessoa.ObterPessoaLogada((int)Membership.GetUser(true).ProviderUserKey).IdPessoa;

            ViewBag.IdPessoa = idPessoa;
            return(View("Index", gPostagem.ObterTodosPorPessoa(idPessoa)));
        }
Exemplo n.º 2
0
        public void ObterTodosPorPessoaInvalidoTest()
        {
            GerenciadorPostagem target = new GerenciadorPostagem();
            int idPessoa = -1;
            IEnumerable <PostagemModel> actual = target.ObterTodosPorPessoa(idPessoa);

            Assert.Equals(0, actual.Count());
            Assert.IsNull(actual);
        }
Exemplo n.º 3
0
        public void ObterTodosPorPessoaValidoTest()
        {
            GerenciadorPostagem target = new GerenciadorPostagem();
            int idPessoa = 17;
            IEnumerable <PostagemModel> actual = target.ObterTodosPorPessoa(idPessoa);

            Assert.Equals(2, actual.Count());
            foreach (var postagem in actual)
            {
                Assert.Equals(postagem.IdPessoa, idPessoa);
            }
        }