File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Async/NHSpecificTest/GH3609 Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ public async Task QueryWithAnyAsync()
6868 var orderCount = await ( session . Query < LineItem > ( ) . CountAsync ( x => validOrders . Any ( y => y == x . Order ) ) ) ;
6969
7070 Assert . That ( orderCount , Is . EqualTo ( 1 ) ) ;
71+ await ( transaction . CommitAsync ( ) ) ;
7172 }
7273
7374 [ Test ]
@@ -82,6 +83,7 @@ public async Task QueryWithAnyOnCleanLinesAsync()
8283 var orderCount = await ( session . Query < CleanLineItem > ( ) . CountAsync ( x => validOrders . Any ( y => y == x . Order ) ) ) ;
8384
8485 Assert . That ( orderCount , Is . EqualTo ( 1 ) ) ;
86+ await ( transaction . CommitAsync ( ) ) ;
8587 }
8688
8789 [ Test ]
@@ -94,6 +96,7 @@ public async Task QueryWithContainsAsync()
9496 var orderCount = await ( session . Query < LineItem > ( ) . CountAsync ( x => validOrders . Contains ( x . Order ) ) ) ;
9597
9698 Assert . That ( orderCount , Is . EqualTo ( 1 ) ) ;
99+ await ( transaction . CommitAsync ( ) ) ;
97100 }
98101
99102 [ Test ]
@@ -105,6 +108,7 @@ public async Task SimpleQueryForDataWhichWasInsertedViaAdoShouldProvideExpectedR
105108 // This style of equivalent query does not exhibit the problem. This test passes no matter which NH version.
106109 var lineItem = await ( session . Query < LineItem > ( ) . FirstOrDefaultAsync ( x => x . Order . CreatedDate > new DateTime ( 2024 , 9 , 10 ) ) ) ;
107110 Assert . That ( lineItem , Is . Not . Null ) ;
111+ await ( transaction . CommitAsync ( ) ) ;
108112 }
109113 }
110114}
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ public void QueryWithAny()
5656 var orderCount = session . Query < LineItem > ( ) . Count ( x => validOrders . Any ( y => y == x . Order ) ) ;
5757
5858 Assert . That ( orderCount , Is . EqualTo ( 1 ) ) ;
59+ transaction . Commit ( ) ;
5960 }
6061
6162 [ Test ]
@@ -70,6 +71,7 @@ public void QueryWithAnyOnCleanLines()
7071 var orderCount = session . Query < CleanLineItem > ( ) . Count ( x => validOrders . Any ( y => y == x . Order ) ) ;
7172
7273 Assert . That ( orderCount , Is . EqualTo ( 1 ) ) ;
74+ transaction . Commit ( ) ;
7375 }
7476
7577 [ Test ]
@@ -82,6 +84,7 @@ public void QueryWithContains()
8284 var orderCount = session . Query < LineItem > ( ) . Count ( x => validOrders . Contains ( x . Order ) ) ;
8385
8486 Assert . That ( orderCount , Is . EqualTo ( 1 ) ) ;
87+ transaction . Commit ( ) ;
8588 }
8689
8790 [ Test ]
@@ -93,6 +96,7 @@ public void SimpleQueryForDataWhichWasInsertedViaAdoShouldProvideExpectedResults
9396 // This style of equivalent query does not exhibit the problem. This test passes no matter which NH version.
9497 var lineItem = session . Query < LineItem > ( ) . FirstOrDefault ( x => x . Order . CreatedDate > new DateTime ( 2024 , 9 , 10 ) ) ;
9598 Assert . That ( lineItem , Is . Not . Null ) ;
99+ transaction . Commit ( ) ;
96100 }
97101 }
98102}
You can’t perform that action at this time.
0 commit comments