Beispiel #1
0
        protected override void Initialize()
        {
            var nte1 = new NamingTestEntity1 {
                Data = "data1"
            };
            var nte2 = new NamingTestEntity1 {
                Data = "data2"
            };

            using (var tx = Session.BeginTransaction())
            {
                id1 = (int)Session.Save(nte1);
                id2 = (int)Session.Save(nte2);
                tx.Commit();
            }
            using (var tx = Session.BeginTransaction())
            {
                nte1.Data = "data1'";
                tx.Commit();
            }
            using (var tx = Session.BeginTransaction())
            {
                nte2.Data = "data2'";
                tx.Commit();
            }
        }
Beispiel #2
0
        public void VerifyHistoryOfId2()
        {
            var ver1 = new NamingTestEntity1 {
                Id = id2, Data = "data2"
            };
            var ver2 = new NamingTestEntity1 {
                Id = id2, Data = "data2'"
            };

            Assert.AreEqual(ver1, AuditReader().Find <NamingTestEntity1>(id2, 1));
            Assert.AreEqual(ver1, AuditReader().Find <NamingTestEntity1>(id2, 2));
            Assert.AreEqual(ver2, AuditReader().Find <NamingTestEntity1>(id2, 3));
        }