public void ManagerCanGetByStatus() { var actual = _postManager.GetAllByStatus("Approved"); Assert.AreEqual(6, actual.Data.Count); Assert.AreEqual(3, actual.Data[0].CategoriesOnPost.Count); }
public IEnumerable <Post> GetApprovedPosts(string status) { var r = new Response <List <Post> >(); if (status == "Approved" && User.IsInRole("Staff")) { r = _postManager.GetAllByStatus(status, User.Identity.GetUserId()); } else { r = _postManager.GetAllByStatus(status); } return(r.Data); }