File tree Expand file tree Collapse file tree 2 files changed +16
-10
lines changed
Async/NHSpecificTest/SqlConverterAndMultiQuery
NHSpecificTest/SqlConverterAndMultiQuery Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change 99
1010
1111using NHibernate . Cfg ;
12- using NHibernate . Dialect ;
12+ using NHibernate . Driver ;
13+ using NHibernate . Engine ;
1314using NUnit . Framework ;
1415
1516namespace NHibernate . Test . NHSpecificTest . SqlConverterAndMultiQuery
@@ -25,11 +26,13 @@ protected override void Configure(Configuration configuration)
2526 configuration . DataBaseIntegration ( x => x . ExceptionConverter < SqlConverter > ( ) ) ;
2627 }
2728
28- protected override bool AppliesTo ( Dialect . Dialect dialect )
29+ protected override bool AppliesTo ( ISessionFactoryImplementor factory )
2930 {
30- // MsSqlCe throws InvalidOperationException instead of a DbException for these tests, preventing
31- // the test SqlConverter to do its job.
32- return ! ( Dialect is MsSqlCeDialect ) ;
31+ // Test current implementation allows to test mmostly SQL Server. Other databases
32+ // tend to (validly) send InvalidOperationException during prepare phase due to the closed
33+ // connection, which get not converted. For testing other case, maybe a failure caused by a
34+ // schema mismatch (like done in transaction tests) would be better.
35+ return factory . ConnectionProvider . Driver is SqlClientDriver ;
3336 }
3437
3538 [ Test ]
Original file line number Diff line number Diff line change 11using NHibernate . Cfg ;
2- using NHibernate . Dialect ;
2+ using NHibernate . Driver ;
3+ using NHibernate . Engine ;
34using NUnit . Framework ;
45
56namespace NHibernate . Test . NHSpecificTest . SqlConverterAndMultiQuery
@@ -14,11 +15,13 @@ protected override void Configure(Configuration configuration)
1415 configuration . DataBaseIntegration ( x => x . ExceptionConverter < SqlConverter > ( ) ) ;
1516 }
1617
17- protected override bool AppliesTo ( Dialect . Dialect dialect )
18+ protected override bool AppliesTo ( ISessionFactoryImplementor factory )
1819 {
19- // MsSqlCe throws InvalidOperationException instead of a DbException for these tests, preventing
20- // the test SqlConverter to do its job.
21- return ! ( Dialect is MsSqlCeDialect ) ;
20+ // Test current implementation allows to test mmostly SQL Server. Other databases
21+ // tend to (validly) send InvalidOperationException during prepare phase due to the closed
22+ // connection, which get not converted. For testing other case, maybe a failure caused by a
23+ // schema mismatch (like done in transaction tests) would be better.
24+ return factory . ConnectionProvider . Driver is SqlClientDriver ;
2225 }
2326
2427 [ Test ]
You can’t perform that action at this time.
0 commit comments