Пример #1
0
        public void CanPushComment()
        {
            // Arrange.
            BlogPost post = CreateBlogPost();

            post.Save();

            // Act.
            var comment = new Comment
            {
                Date = DateTime.Now,
                Name = "Tim Jones"
            };

            BlogPost.Push(post.ID, p => p.Comments, comment);

            // Assert.
            BlogPost myPost = BlogPost.Find(post.ID);

            Assert.That(myPost.Comments.Count, Is.EqualTo(1));
            Assert.That(myPost.Comments[0].Name, Is.EqualTo("Tim Jones"));
        }