Beispiel #1
0
        public void IncUpdatesDatabaseAndLocalValuesForSimpleProperty()
        {
            // Arrange.
            BlogPost post = CreateBlogPost();

            post.ReadCount = 3;
            post.Save();

            // Act.
            post.Inc(p => p.ReadCount, 1);

            // Assert.
            Assert.That(post.ReadCount, Is.EqualTo(4));
            Assert.That(BlogPost.Find(post.ID).ReadCount, Is.EqualTo(4));
        }