コード例 #1
0
        public async Task Should_Get_Post_By_Id()
        {
            // Arrange
            _posts.AddRange(TestPosts);
            var postId = TestPosts[0].PostId;

            // Act
            var post = await _postProvider.GetPost(postId);

            // Assert
            Assert.AreEqual(postId, post.PostId);
        }
コード例 #2
0
 public ActionResult GetPost(int postId)
 {
     return(View(ConvertPostToPostViewModel(_postProvider.GetPost(postId))));
 }
コード例 #3
0
        public async Task <Post> GetPost(int postId)
        {
            var post = await _postProvider.GetPost(postId);

            return(_mapper.Map <Post>(post));
        }
コード例 #4
0
        public ActionResult PostDetails(int postId)
        {
            Post post = _postProvider.GetPost(postId);

            return(View("PostDetails", post));
        }