Skip to content

Commit 4254866

Browse files
Do some additional cleanup
1 parent b6f6be0 commit 4254866

File tree

6 files changed

+9
-73
lines changed

6 files changed

+9
-73
lines changed

src/NHibernate.Test/Async/NHSpecificTest/NH3848/CriteriaTestFixture.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,6 @@ namespace NHibernate.Test.NHSpecificTest.NH3848
1919
using System.Threading;
2020
public class CriteriaTestFixtureAsync : FixtureAsync
2121
{
22-
protected override Task<IList<Customer>> GetCustomersWithFetchedOrdersWithoutRestrictionsAsync(ISession session, CancellationToken cancellationToken = default(CancellationToken))
23-
{
24-
try
25-
{
26-
return
27-
session
28-
.CreateCriteria<Customer>()
29-
.CreateAlias("Orders", "order", JoinType.LeftOuterJoin)
30-
.SetResultTransformer(new DistinctRootEntityResultTransformer())
31-
.ListAsync<Customer>(cancellationToken);
32-
}
33-
catch (System.Exception ex)
34-
{
35-
return Task.FromException<IList<Customer>>(ex);
36-
}
37-
}
38-
3922
protected override Task<IList<Customer>> GetCustomersWithOrdersEagerLoadedAsync(ISession session, CancellationToken cancellationToken = default(CancellationToken))
4023
{
4124
try

src/NHibernate.Test/Async/NHSpecificTest/NH3848/Fixture.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -338,13 +338,13 @@ public virtual async Task ChildCollectionsFromLeftOuterJoinOnlyWithRestrictionSh
338338

339339
Assert.That(
340340
customersWithOrderNumberEqualsTo2AndCompanies.First(n => n.Id == Customer1.Id).Companies,
341-
Has.Count.EqualTo(Customer1.Companies.Count()));
341+
Has.Count.EqualTo(Customer1.Companies.Count));
342342
Assert.That(
343343
customersWithOrderNumberEqualsTo2AndCompanies.First(n => n.Id == Customer2.Id).Companies,
344-
Has.Count.EqualTo(Customer2.Companies.Count()));
344+
Has.Count.EqualTo(Customer2.Companies.Count));
345345
Assert.That(
346346
customersWithOrderNumberEqualsTo2AndCompanies.First(n => n.Id == Customer3.Id).Companies,
347-
Has.Count.EqualTo(Customer3.Companies.Count()));
347+
Has.Count.EqualTo(Customer3.Companies.Count));
348348

349349
Assert.That(customers.Single(n => n.Id == Customer1.Id).Orders, Has.Count.EqualTo(0));
350350
Assert.That(customers.Single(n => n.Id == Customer2.Id).Orders, Has.Count.EqualTo(0));
@@ -372,7 +372,7 @@ public virtual async Task ChildCollectionsFromLeftOuterJoinOnlyWithRestrictionSh
372372
if (!entityPersister.HasCache)
373373
return;
374374

375-
var querySpaces = entityPersister.QuerySpaces.Cast<string>().ToList().AsReadOnly();
375+
var querySpaces = entityPersister.QuerySpaces.ToList().AsReadOnly();
376376
await (Sfi.UpdateTimestampsCache.PreInvalidateAsync(querySpaces, cancellationToken));
377377
}
378378

@@ -384,7 +384,7 @@ protected void ClearSecondLevelCacheFor(System.Type entity)
384384
if (!entityPersister.HasCache)
385385
return;
386386

387-
var querySpaces = entityPersister.QuerySpaces.Cast<string>().ToList().AsReadOnly();
387+
var querySpaces = entityPersister.QuerySpaces.ToList().AsReadOnly();
388388
Sfi.UpdateTimestampsCache.PreInvalidate(querySpaces);
389389
}
390390

@@ -417,7 +417,6 @@ protected void ClearCollectionCache<T>(Expression<Func<T, IEnumerable>> pathToCo
417417
Sfi.EvictCollection(role);
418418
}
419419

420-
protected abstract Task<IList<Customer>> GetCustomersWithFetchedOrdersWithoutRestrictionsAsync(ISession session, CancellationToken cancellationToken = default(CancellationToken));
421420
protected abstract Task<IList<Customer>> GetCustomersWithOrdersEagerLoadedAsync(ISession session, CancellationToken cancellationToken = default(CancellationToken));
422421
protected abstract Task<IList<Customer>> GetCustomersByOrderNumberUsingOnClauseAsync(ISession session, int orderNumber, CancellationToken cancellationToken = default(CancellationToken));
423422
protected abstract Task<IList<Customer>> GetCustomersByOrderNumberUsingWhereClauseAsync(ISession session, int orderNumber, CancellationToken cancellationToken = default(CancellationToken));

src/NHibernate.Test/Async/NHSpecificTest/NH3848/QueryOverTestFixture.cs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,6 @@ namespace NHibernate.Test.NHSpecificTest.NH3848
1919
using System.Threading;
2020
public class QueryOverTestFixtureAsync : FixtureAsync
2121
{
22-
protected override Task<IList<Customer>> GetCustomersWithFetchedOrdersWithoutRestrictionsAsync(ISession session, CancellationToken cancellationToken = default(CancellationToken))
23-
{
24-
try
25-
{
26-
Order ordersAlias = null;
27-
return
28-
session
29-
.QueryOver<Customer>()
30-
.JoinAlias(
31-
n => n.Orders,
32-
() => ordersAlias,
33-
JoinType.LeftOuterJoin)
34-
.TransformUsing(new DistinctRootEntityResultTransformer())
35-
.ListAsync(cancellationToken);
36-
}
37-
catch (System.Exception ex)
38-
{
39-
return Task.FromException<IList<Customer>>(ex);
40-
}
41-
}
42-
4322
protected override Task<IList<Customer>> GetCustomersWithOrdersEagerLoadedAsync(ISession session, CancellationToken cancellationToken = default(CancellationToken))
4423
{
4524
try

src/NHibernate.Test/NHSpecificTest/NH3848/CriteriaTestFixture.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,6 @@ namespace NHibernate.Test.NHSpecificTest.NH3848
77
{
88
public class CriteriaTestFixture : Fixture
99
{
10-
protected override IList<Customer> GetCustomersWithFetchedOrdersWithoutRestrictions(ISession session)
11-
{
12-
return
13-
session
14-
.CreateCriteria<Customer>()
15-
.CreateAlias("Orders", "order", JoinType.LeftOuterJoin)
16-
.SetResultTransformer(new DistinctRootEntityResultTransformer())
17-
.List<Customer>();
18-
}
19-
2010
protected override IList<Customer> GetCustomersWithOrdersEagerLoaded(ISession session)
2111
{
2212
return

src/NHibernate.Test/NHSpecificTest/NH3848/Fixture.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,13 @@ public virtual void ChildCollectionsFromLeftOuterJoinOnlyWithRestrictionShouldNo
326326

327327
Assert.That(
328328
customersWithOrderNumberEqualsTo2AndCompanies.First(n => n.Id == Customer1.Id).Companies,
329-
Has.Count.EqualTo(Customer1.Companies.Count()));
329+
Has.Count.EqualTo(Customer1.Companies.Count));
330330
Assert.That(
331331
customersWithOrderNumberEqualsTo2AndCompanies.First(n => n.Id == Customer2.Id).Companies,
332-
Has.Count.EqualTo(Customer2.Companies.Count()));
332+
Has.Count.EqualTo(Customer2.Companies.Count));
333333
Assert.That(
334334
customersWithOrderNumberEqualsTo2AndCompanies.First(n => n.Id == Customer3.Id).Companies,
335-
Has.Count.EqualTo(Customer3.Companies.Count()));
335+
Has.Count.EqualTo(Customer3.Companies.Count));
336336

337337
Assert.That(customers.Single(n => n.Id == Customer1.Id).Orders, Has.Count.EqualTo(0));
338338
Assert.That(customers.Single(n => n.Id == Customer2.Id).Orders, Has.Count.EqualTo(0));
@@ -360,7 +360,7 @@ protected void ClearSecondLevelCacheFor(System.Type entity)
360360
if (!entityPersister.HasCache)
361361
return;
362362

363-
var querySpaces = entityPersister.QuerySpaces.Cast<string>().ToList().AsReadOnly();
363+
var querySpaces = entityPersister.QuerySpaces.ToList().AsReadOnly();
364364
Sfi.UpdateTimestampsCache.PreInvalidate(querySpaces);
365365
}
366366

@@ -375,7 +375,6 @@ protected void ClearCollectionCache<T>(Expression<Func<T, IEnumerable>> pathToCo
375375
Sfi.EvictCollection(role);
376376
}
377377

378-
protected abstract IList<Customer> GetCustomersWithFetchedOrdersWithoutRestrictions(ISession session);
379378
protected abstract IList<Customer> GetCustomersWithOrdersEagerLoaded(ISession session);
380379
protected abstract IList<Customer> GetCustomersByOrderNumberUsingOnClause(ISession session, int orderNumber);
381380
protected abstract IList<Customer> GetCustomersByOrderNumberUsingWhereClause(ISession session, int orderNumber);

src/NHibernate.Test/NHSpecificTest/NH3848/QueryOverTestFixture.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,6 @@ namespace NHibernate.Test.NHSpecificTest.NH3848
77
{
88
public class QueryOverTestFixture : Fixture
99
{
10-
protected override IList<Customer> GetCustomersWithFetchedOrdersWithoutRestrictions(ISession session)
11-
{
12-
Order ordersAlias = null;
13-
return
14-
session
15-
.QueryOver<Customer>()
16-
.JoinAlias(
17-
n => n.Orders,
18-
() => ordersAlias,
19-
JoinType.LeftOuterJoin)
20-
.TransformUsing(new DistinctRootEntityResultTransformer())
21-
.List();
22-
}
23-
2410
protected override IList<Customer> GetCustomersWithOrdersEagerLoaded(ISession session)
2511
{
2612
return

0 commit comments

Comments
 (0)