コード例 #1
0
        public void ShouldKnowHowToEditAModelByItsIdWhenItExists()
        {
            var book = new Book {Id = 1, Title = "The Book"};
            var dbContext = new Mock<PukuDbContext>();
            dbContext.Setup(ctx => ctx.SetModified(book));
            var efRepo = new EntityFrameworkRepository(dbContext.Object);

            efRepo.Edit(book);

            dbContext.Verify(ctx => ctx.SetModified(book));
        }