protected override void Initialize() { //Revision 1 using (var tx = Session.BeginTransaction()) { var propertyEntity = new PropertyOverrideTestEntity { Number1 = 1, Str1 = "data 1", Str2 = "data 2" }; propertyEntityId = (int)Session.Save(propertyEntity); tx.Commit(); } //Revision 2 using (var tx = Session.BeginTransaction()) { var transitiveEntity = new TransitiveOverrideTestEntity { Number1 = 1, Number2 = 2, Str1 = "data 1", Str2 = "data 2", Str3 = "data 3" }; transitiveEntityId = (int)Session.Save(transitiveEntity); tx.Commit(); } //Revision 3 using (var tx = Session.BeginTransaction()) { var auditedEntity = new AuditedSpecialEntity { Number1 = 1, Str1 = "data 1", Str2 = "data 2" }; auditedEntityId = (int)Session.Save(auditedEntity); tx.Commit(); } }
public void VerifyHistoryOfAuditedSpecialEntity() { var ver1 = new AuditedSpecialEntity { Id = auditedEntityId, Number1 = 0, Str1 = "data 1", Str2 = "data 2" }; AuditReader().Find <AuditedSpecialEntity>(auditedEntityId, 3) .Should().Be.EqualTo(ver1); }