Skip to content

Commit df804a8

Browse files
fixup! Support evaluation of Random.Next and NextDouble on db side
Fix a test error causing 10% of runs to fail.
1 parent 85d6f77 commit df804a8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/NHibernate.Test/Async/Linq/PreEvaluationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ public async Task CanQueryByRandomIntWithMaxAsync()
309309
using (var spy = new SqlLogSpy())
310310
{
311311
var random = new Random();
312-
var x = await (db.Orders.CountAsync(o => o.OrderId - idMin - 1 < random.Next(10)));
312+
var x = await (db.Orders.CountAsync(o => o.OrderId - idMin < random.Next(10)));
313313

314314
Assert.That(x, Is.GreaterThan(0).And.LessThan(10));
315315
// Next requires support of both floor and rand

src/NHibernate.Test/Linq/PreEvaluationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ public void CanQueryByRandomIntWithMax()
297297
using (var spy = new SqlLogSpy())
298298
{
299299
var random = new Random();
300-
var x = db.Orders.Count(o => o.OrderId - idMin - 1 < random.Next(10));
300+
var x = db.Orders.Count(o => o.OrderId - idMin < random.Next(10));
301301

302302
Assert.That(x, Is.GreaterThan(0).And.LessThan(10));
303303
// Next requires support of both floor and rand

0 commit comments

Comments
 (0)