Example #1
0
        public void LogChanges_Delete()
        {
            var tbl = new Table(Schema.GetForTypedRow(typeof(Person)));

            tbl.Insert( new Person{
                                    ID = "POP1",
                                    FirstName = "Oleg",
                                    LastName = "Popov",
                                    DOB = new DateTime(1953, 12, 10),
                                    YearsInSpace = 12
                                   });
            tbl.LogChanges = true;

            tbl.Delete( tbl[0] );

            Assert.AreEqual(1, tbl.ChangeCount);
            Assert.AreEqual(0, tbl.Count);

            Assert.AreEqual(RowChangeType.Delete, tbl.GetChangeAt(0).Value.ChangeType);
        }