示例#1
0
        public void CreatePost_NoContent_ShouldFail()
        {
            // arrange
            var postWriter = new PostWriter(_mockPostRepo.Object, _mockCommentRepo.Object, null);

            // act
            Action action = () =>
                            postWriter.CreatePost(null);

            // assert
            action.ShouldThrow <Exception>();
        }
示例#2
0
 public int CreateNew(Post post, int?groupId)
 {
     return(_postWriter.CreatePost(post.Body, groupId));
 }
示例#3
0
        public ActionResult Index(Post post, int?groupId)
        {
            var id = _postWriter.CreatePost(post.Body, groupId);

            return(RedirectToAction("Get", new { Id = id }));
        }