Skip to content

Commit 4e84dbc

Browse files
Generate Async test for deep removal of fetch.
* Finishes #1559.
1 parent 6987985 commit 4e84dbc

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

src/NHibernate.Test/Async/Linq/ByMethod/AnyTests.cs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,29 @@ public async Task AnyWithCountAsync()
6262
}
6363

6464
[Test]
65-
public async Task AnyWithFetchAsync()
65+
public void AnyWithFetchAsync()
6666
{
6767
//NH-3241
68-
var result = await (db.Orders.Fetch(x => x.Customer).FetchMany(x => x.OrderLines).AnyAsync());
68+
Assert.DoesNotThrowAsync(async () =>
69+
{
70+
var result = await (db.Orders.Fetch(x => x.Customer).FetchMany(x => x.OrderLines).AnyAsync());
71+
}
72+
);
73+
}
74+
75+
[Test]
76+
public void AnyWithFetchInSubQueryAsync()
77+
{
78+
Assert.DoesNotThrowAsync(async () =>
79+
{
80+
var result = await (db.Orders
81+
.Where(x => x.Customer.CustomerId == "Test")
82+
.Fetch(x => x.Customer)
83+
.FetchMany(x => x.OrderLines)
84+
.Where(x => x.Freight > 1)
85+
.CountAsync());
86+
}
87+
);
6988
}
7089
}
7190
}

0 commit comments

Comments
 (0)