public ActionResult MinhasPostagens() { int idPessoa = gPessoa.ObterPessoaLogada((int)Membership.GetUser(true).ProviderUserKey).IdPessoa; ViewBag.IdPessoa = idPessoa; return(View("Index", gPostagem.ObterTodosPorPessoa(idPessoa))); }
public void ObterTodosPorPessoaInvalidoTest() { GerenciadorPostagem target = new GerenciadorPostagem(); int idPessoa = -1; IEnumerable <PostagemModel> actual = target.ObterTodosPorPessoa(idPessoa); Assert.Equals(0, actual.Count()); Assert.IsNull(actual); }
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); } }