File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
Src/NHibernate.Envers.Tests/NetSpecific/Integration/ComponentAsId Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1
1
using NUnit . Framework ;
2
+ using NHibernate . Envers . Query ;
2
3
3
4
namespace NHibernate . Envers . Tests . NetSpecific . Integration . ComponentAsId
4
5
{
@@ -43,6 +44,44 @@ public void ComponentAsIdTestMethod()
43
44
} ) ;
44
45
}
45
46
47
+ [ Test ]
48
+ public void ComponentAsIdGetAudit ( )
49
+ {
50
+ var ent1 = new Entity1
51
+ {
52
+ Id = 1
53
+ } ;
54
+
55
+ Save ( ent1 ) ;
56
+
57
+ var ent2 = new Entity2 ( )
58
+ {
59
+ Id = 1
60
+ } ;
61
+
62
+ Save ( ent2 ) ;
63
+
64
+ var udf = new SomeEntUDF
65
+ {
66
+ Id = new ComponentAsId
67
+ {
68
+ Key1 = ent1 ,
69
+ Key2 = ent2
70
+ } ,
71
+ } ;
72
+
73
+ Save ( udf ) ;
74
+
75
+
76
+ var history = Session . Auditer ( ) . CreateQuery ( )
77
+ . ForRevisionsOfEntity ( typeof ( SomeEntUDF ) , false , true )
78
+ . Add ( AuditEntity . Property ( "Id.Key1.Id" ) . Eq ( ent1 . Id ) )
79
+ . GetResultList ( ) ;
80
+
81
+ Assert . AreEqual ( 1 , history . Count ) ;
82
+
83
+ }
84
+
46
85
void Save ( object o )
47
86
{
48
87
using ( var tran = Session . BeginTransaction ( ) )
You can’t perform that action at this time.
0 commit comments