public void user_can_see_other_users_approved_comments() { using (UoW.Create()) { NewPost() .ReplyTo(new UserInfo("Roger", "", "", "myid"), "this comment should be listed") .Approve(); PostProjectionWithComments presentedPost = PostProjections.GetById(0, "otherid"); //the comment is approved, we should get one Assert.AreEqual(1, presentedPost.Comments.Count()); } }
protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); string userId = Request.UserHostAddress; using (UoW.Create()) { PostProjectionWithComments post = PostProjections.GetById(PostId, userId); PublshDateLabel.Text = post.PublishDateString; SubjectLabel.Text = post.Subject; BodyLabel.Text = post.Body; CategoryLabel.Text = post.CategoryString; CommentRepeater.DataSource = post.Comments; CommentRepeater.DataBind(); } }