Exemplo n.º 1
0
        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)
                );
        }
Exemplo n.º 2
0
 public IEnumerable <Post> GetPosts()
 {
     return(_iPostProvider.GetAllPosts());
 }
Exemplo n.º 3
0
        public async Task <ICollection <Post> > AllPosts()
        {
            var posts = await _postProvider.GetAllPosts();

            return(_mapper.Map <ICollection <Post> >(posts));
        }
Exemplo n.º 4
0
        public ActionResult Posts()
        {
            IList <Post> posts = _postProvider.GetAllPosts();

            return(View("PostsView", posts));
        }
Exemplo n.º 5
0
 public List <Post> GetAllPosts()
 {
     return(_postProvider.GetAllPosts());
 }