Skip to content

Commit a97627d

Browse files
authored
Cache Dialect in tests (#2851)
1 parent 0820f87 commit a97627d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/NHibernate.Test/TestCase.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public abstract class TestCase
3333

3434
private static readonly ILog log = LogManager.GetLogger(typeof(TestCase));
3535
private static readonly FieldInfo PlanCacheField;
36+
private Dialect.Dialect _dialect;
37+
private TestDialect _testDialect;
3638

3739
static TestCase()
3840
{
@@ -44,12 +46,12 @@ static TestCase()
4446

4547
protected Dialect.Dialect Dialect
4648
{
47-
get { return NHibernate.Dialect.Dialect.GetDialect(cfg.Properties); }
49+
get { return _dialect ?? (_dialect = NHibernate.Dialect.Dialect.GetDialect(cfg.Properties)); }
4850
}
4951

5052
protected TestDialect TestDialect
5153
{
52-
get { return TestDialect.GetTestDialect(Dialect); }
54+
get { return _testDialect ?? (_testDialect = TestDialect.GetTestDialect(Dialect)); }
5355
}
5456

5557
/// <summary>

0 commit comments

Comments
 (0)