public async Task Should_Get_All_Posts() { // Arrange _posts.AddRange(TestPosts); //Act var posts = await _postProvider.GetAllPosts(); //Assert Assert.AreEqual(TestPosts.Count, posts.Count); CollectionAssert.AreEqual( TestPosts.Select(x => x.PostId), posts.Select(x => x.PostId) ); }
public IEnumerable <Post> GetPosts() { return(_iPostProvider.GetAllPosts()); }
public async Task <ICollection <Post> > AllPosts() { var posts = await _postProvider.GetAllPosts(); return(_mapper.Map <ICollection <Post> >(posts)); }
public ActionResult Posts() { IList <Post> posts = _postProvider.GetAllPosts(); return(View("PostsView", posts)); }
public List <Post> GetAllPosts() { return(_postProvider.GetAllPosts()); }