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); }
public ActionResult GetPost(int postId) { return(View(ConvertPostToPostViewModel(_postProvider.GetPost(postId)))); }
public async Task <Post> GetPost(int postId) { var post = await _postProvider.GetPost(postId); return(_mapper.Map <Post>(post)); }
public ActionResult PostDetails(int postId) { Post post = _postProvider.GetPost(postId); return(View("PostDetails", post)); }