File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Async/NHSpecificTest/SqlConverterAndMultiQuery
NHSpecificTest/SqlConverterAndMultiQuery Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 10
10
11
11
using NHibernate . Cfg ;
12
12
using NHibernate . Dialect ;
13
+ using NHibernate . Util ;
13
14
using NUnit . Framework ;
14
15
15
16
namespace NHibernate . Test . NHSpecificTest . SqlConverterAndMultiQuery
@@ -27,9 +28,12 @@ protected override void Configure(Configuration configuration)
27
28
28
29
protected override bool AppliesTo ( Dialect . Dialect dialect )
29
30
{
30
- // MsSqlCe throws InvalidOperationException instead of a DbException for these tests, preventing
31
+ // If prepare_sql is enabled, with most databases prepare will fail with an InvalidOperationException,
32
+ // turned into ADOException by prepare code and then not passed to the exception converter.
33
+ // MsSqlCe throws InvalidOperationException during Prepare (even when disabled), preventing
31
34
// the test SqlConverter to do its job.
32
- return ! ( Dialect is MsSqlCeDialect ) ;
35
+ var prepareSql = PropertiesHelper . GetBoolean ( Environment . PrepareSql , cfg . Properties , false ) ;
36
+ return ! ( prepareSql || Dialect is MsSqlCeDialect ) ;
33
37
}
34
38
35
39
[ Test ]
Original file line number Diff line number Diff line change 1
1
using NHibernate . Cfg ;
2
2
using NHibernate . Dialect ;
3
+ using NHibernate . Util ;
3
4
using NUnit . Framework ;
4
5
5
6
namespace NHibernate . Test . NHSpecificTest . SqlConverterAndMultiQuery
@@ -16,9 +17,12 @@ protected override void Configure(Configuration configuration)
16
17
17
18
protected override bool AppliesTo ( Dialect . Dialect dialect )
18
19
{
19
- // MsSqlCe throws InvalidOperationException instead of a DbException for these tests, preventing
20
+ // If prepare_sql is enabled, with most databases prepare will fail with an InvalidOperationException,
21
+ // turned into ADOException by prepare code and then not passed to the exception converter.
22
+ // MsSqlCe throws InvalidOperationException during Prepare (even when disabled), preventing
20
23
// the test SqlConverter to do its job.
21
- return ! ( Dialect is MsSqlCeDialect ) ;
24
+ var prepareSql = PropertiesHelper . GetBoolean ( Environment . PrepareSql , cfg . Properties , false ) ;
25
+ return ! ( prepareSql || Dialect is MsSqlCeDialect ) ;
22
26
}
23
27
24
28
[ Test ]
You can’t perform that action at this time.
0 commit comments