Exemple #1
0
        [Fact] public void Reject_ShouldUnstageAllPendingChanges()
        {
            _inMemoryContext.Posts.Add(new BlogPost {
                BlogPostId = Guid.NewGuid()
            });

            _inMemoryContext.ChangeTracker.Entries <BlogPost>().Select(e => e.State)
            .Should().AllBeEquivalentTo(EntityState.Added,
                                        "we haven't commited anything yet");

            _unitOfWork.Reject();

            _inMemoryContext.ChangeTracker.Entries <BlogPost>().Select(e => e.State)
            .Should().AllBeEquivalentTo(EntityState.Unchanged,
                                        "we called Reject()");
        }