Skip to content

Cache Dialect in tests #2851

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/NHibernate.Test/TestCase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public abstract class TestCase

private static readonly ILog log = LogManager.GetLogger(typeof(TestCase));
private static readonly FieldInfo PlanCacheField;
private Dialect.Dialect _dialect;
private TestDialect _testDialect;

static TestCase()
{
Expand All @@ -44,12 +46,12 @@ static TestCase()

protected Dialect.Dialect Dialect
{
get { return NHibernate.Dialect.Dialect.GetDialect(cfg.Properties); }
get { return _dialect ?? (_dialect = NHibernate.Dialect.Dialect.GetDialect(cfg.Properties)); }
}

protected TestDialect TestDialect
{
get { return TestDialect.GetTestDialect(Dialect); }
get { return _testDialect ?? (_testDialect = TestDialect.GetTestDialect(Dialect)); }
}

/// <summary>
Expand Down