Пример #1
0
        public void Update()
        {
            // Arrange
            FakeDbContext db = new FakeDbContext();

            db.AddSet(TestData.Contacts);

            // Act
            var contact2 = db.Find <Contact>(2);

            contact2.Title = "Brain Surgeon";
            db.Update <Contact>(contact2);
            var updatedContact = db.Find <Contact>(2);

            // Assert
            Assert.AreEqual("Brain Surgeon", updatedContact.Title,
                            "Updated contact title check failed");
            Assert.AreEqual(1, db.Updated.Count,
                            "Updated contact count check failed");
        }