File tree Expand file tree Collapse file tree 1 file changed +59
-0
lines changed
src/NHibernate.Test/Async/NHSpecificTest/GH1565 Expand file tree Collapse file tree 1 file changed +59
-0
lines changed Original file line number Diff line number Diff line change
1
+ //------------------------------------------------------------------------------
2
+ // <auto-generated>
3
+ // This code was generated by AsyncGenerator.
4
+ //
5
+ // Changes to this file may cause incorrect behavior and will be lost if
6
+ // the code is regenerated.
7
+ // </auto-generated>
8
+ //------------------------------------------------------------------------------
9
+
10
+
11
+ using NUnit . Framework ;
12
+
13
+ namespace NHibernate . Test . NHSpecificTest . GH1565
14
+ {
15
+ using System . Threading . Tasks ;
16
+ [ TestFixture ]
17
+ public class LockEntityWithOuterJoinTestAsync : BugTestCase
18
+ {
19
+ [ Test ]
20
+ public async Task LockWithOuterJoin_ShouldBePossibleAsync ( )
21
+ {
22
+ using ( var session = OpenSession ( ) )
23
+ {
24
+ using ( var transaction = session . BeginTransaction ( ) )
25
+ {
26
+ var entity = await ( session . GetAsync < MainEntity > ( id , LockMode . Upgrade ) ) ;
27
+ Assert . That ( entity . Id , Is . EqualTo ( id ) ) ;
28
+ await ( transaction . CommitAsync ( ) ) ;
29
+ }
30
+ }
31
+ }
32
+
33
+ private int id ;
34
+ protected override void OnSetUp ( )
35
+ {
36
+ base . OnSetUp ( ) ;
37
+ using ( var session = OpenSession ( ) )
38
+ {
39
+ using ( var transaction = session . BeginTransaction ( ) )
40
+ {
41
+ session . FlushMode = FlushMode . Auto ;
42
+ var entity = new MainEntity ( ) ;
43
+ session . Save ( entity ) ;
44
+ transaction . Commit ( ) ;
45
+ id = entity . Id ;
46
+ }
47
+ }
48
+ }
49
+
50
+ protected override void OnTearDown ( )
51
+ {
52
+ base . OnTearDown ( ) ;
53
+ using ( var session = OpenSession ( ) )
54
+ {
55
+ session . CreateSQLQuery ( "delete from MainEntity" ) . ExecuteUpdate ( ) ;
56
+ }
57
+ }
58
+ }
59
+ }
You can’t perform that action at this time.
0 commit comments