Get() public method

public Get ( int postId ) : PostViewModel
postId int
return InsanelySimpleBlog.ViewModel.PostViewModel
コード例 #1
0
        public void GetReturnsCorrectPost()
        {
            // Arrange
            PostViewModel mappedPost = new PostViewModel {PostID = 2};
            PostsService service = new PostsService(_unitOfWorkFactory, _mapper);
            _mapper.Stub(x => x.Map(_post2)).Return(mappedPost);

            // Act
            PostViewModel model = service.Get(2);

            // Assert
            Assert.That(model, Is.EqualTo(mappedPost));
        }