@@ -16,12 +16,13 @@ namespace NHibernate.Envers.Tests
16
16
{
17
17
public abstract class OneStrategyTestBase
18
18
{
19
+ private ISessionFactory _sessionFactory ;
20
+ private IAuditReader _auditReader ;
21
+
19
22
protected string TestAssembly { get ; private set ; }
20
23
protected Cfg . Configuration Cfg { get ; private set ; }
21
24
protected ISession Session { get ; private set ; }
22
25
protected System . Type StrategyType { get ; private set ; }
23
- private ISessionFactory SessionFactory { get ; set ; }
24
- private IAuditReader _auditReader ;
25
26
26
27
protected OneStrategyTestBase ( AuditStrategyForTest strategyType )
27
28
{
@@ -53,30 +54,30 @@ public void BaseSetup()
53
54
Cfg . Configure ( configurationFile ( ) ) ;
54
55
addMappings ( ) ;
55
56
Cfg . IntegrateWithEnvers ( new AuditEventListener ( ) , EnversConfiguration ( ) ) ;
56
- SessionFactory = Cfg . BuildSessionFactory ( ) ;
57
+ _sessionFactory = Cfg . BuildSessionFactory ( ) ;
57
58
var notRun = TestShouldNotRunMessage ( ) ;
58
59
if ( ! string . IsNullOrEmpty ( notRun ) )
59
60
Assert . Ignore ( notRun ) ;
60
- Session = openSession ( SessionFactory ) ;
61
+ Session = openSession ( _sessionFactory ) ;
61
62
Initialize ( ) ;
62
63
closeSessionAndAuditReader ( ) ;
63
- Session = openSession ( SessionFactory ) ;
64
+ Session = openSession ( _sessionFactory ) ;
64
65
}
65
66
66
67
[ TearDown ]
67
68
public void BaseTearDown ( )
68
69
{
69
70
closeSessionAndAuditReader ( ) ;
70
71
AuditConfiguration . Remove ( Cfg ) ;
71
- SessionFactory ? . Close ( ) ;
72
+ _sessionFactory ? . Close ( ) ;
72
73
}
73
74
74
75
protected virtual string TestShouldNotRunMessage ( )
75
76
{
76
77
return null ;
77
78
}
78
79
79
- protected Dialect . Dialect Dialect => ( ( ISessionFactoryImplementor ) SessionFactory ) . Dialect ;
80
+ protected Dialect . Dialect Dialect => ( ( ISessionFactoryImplementor ) _sessionFactory ) . Dialect ;
80
81
81
82
protected virtual IMetaDataProvider EnversConfiguration ( )
82
83
{
@@ -118,7 +119,7 @@ private string nameSpaceAssemblyExtracted()
118
119
protected void ForceNewSession ( )
119
120
{
120
121
Session . Close ( ) ;
121
- Session = SessionFactory . OpenSession ( ) ;
122
+ Session = _sessionFactory . OpenSession ( ) ;
122
123
_auditReader = null ;
123
124
}
124
125
0 commit comments