@@ -37,7 +37,7 @@ public void CanSetAutoClose()
37
37
private void CanSetAutoClose < T > ( T sb ) where T : ISessionBuilder < T >
38
38
{
39
39
var options = ( ISessionCreationOptions ) sb ;
40
- CanSet ( sb , sb . AutoClose , options . ShouldAutoClose ,
40
+ CanSet ( sb , sb . AutoClose , ( ) => options . ShouldAutoClose ,
41
41
sb is ISharedSessionBuilder ssb ? ssb . AutoClose : default ( Func < ISharedSessionBuilder > ) ,
42
42
// initial values
43
43
false ,
@@ -63,34 +63,34 @@ private void CanSetConnection<T>(T sb) where T : ISessionBuilder<T>
63
63
try
64
64
{
65
65
var options = ( ISessionCreationOptions ) sb ;
66
- Assert . IsNull ( options . GetConnection ( ) , $ "{ sbType } : Initial value") ;
66
+ Assert . IsNull ( options . UserSuppliedConnection , $ "{ sbType } : Initial value") ;
67
67
var fsb = sb . Connection ( conn ) ;
68
- Assert . AreEqual ( conn , options . GetConnection ( ) , $ "{ sbType } : After call with a connection") ;
68
+ Assert . AreEqual ( conn , options . UserSuppliedConnection , $ "{ sbType } : After call with a connection") ;
69
69
Assert . AreEqual ( sb , fsb , $ "{ sbType } : Unexpected fluent return after call with a connection") ;
70
70
71
71
if ( sb is ISharedSessionBuilder ssb )
72
72
{
73
73
var sharedOptions = ( ISharedSessionCreationOptions ) options ;
74
- Assert . IsFalse ( sharedOptions . IsTransactionCoordinatorShared ( ) , $ "{ sbType } : Transaction coordinator shared before sharing") ;
75
- Assert . IsNull ( sharedOptions . GetConnectionManager ( ) , $ "{ sbType } : Connection manager shared before sharing") ;
74
+ Assert . IsFalse ( sharedOptions . IsTransactionCoordinatorShared , $ "{ sbType } : Transaction coordinator shared before sharing") ;
75
+ Assert . IsNull ( sharedOptions . ConnectionManager , $ "{ sbType } : Connection manager shared before sharing") ;
76
76
77
77
var fssb = ssb . Connection ( ) ;
78
78
// Sharing connection shares the connection manager, not the connection.
79
- Assert . IsNull ( options . GetConnection ( ) , $ "{ sbType } : After call with previous session connection") ;
80
- Assert . IsTrue ( sharedOptions . IsTransactionCoordinatorShared ( ) , $ "{ sbType } : Transaction coordinator not shared after sharing") ;
81
- Assert . IsNotNull ( sharedOptions . GetConnectionManager ( ) , $ "{ sbType } : Connection manager not shared after sharing") ;
79
+ Assert . IsNull ( options . UserSuppliedConnection , $ "{ sbType } : After call with previous session connection") ;
80
+ Assert . IsTrue ( sharedOptions . IsTransactionCoordinatorShared , $ "{ sbType } : Transaction coordinator not shared after sharing") ;
81
+ Assert . IsNotNull ( sharedOptions . ConnectionManager , $ "{ sbType } : Connection manager not shared after sharing") ;
82
82
Assert . AreEqual ( sb , fssb , $ "{ sbType } : Unexpected fluent return on shared") ;
83
83
84
84
fsb = sb . Connection ( null ) ;
85
- Assert . IsNull ( options . GetConnection ( ) , $ "{ sbType } : After call with null") ;
86
- Assert . IsFalse ( sharedOptions . IsTransactionCoordinatorShared ( ) , $ "{ sbType } : Transaction coordinator shared after un-sharing") ;
87
- Assert . IsNull ( sharedOptions . GetConnectionManager ( ) , $ "{ sbType } : Connection manager shared after un-sharing") ;
85
+ Assert . IsNull ( options . UserSuppliedConnection , $ "{ sbType } : After call with null") ;
86
+ Assert . IsFalse ( sharedOptions . IsTransactionCoordinatorShared , $ "{ sbType } : Transaction coordinator shared after un-sharing") ;
87
+ Assert . IsNull ( sharedOptions . ConnectionManager , $ "{ sbType } : Connection manager shared after un-sharing") ;
88
88
Assert . AreEqual ( sb , fsb , $ "{ sbType } : Unexpected fluent return after un-sharing") ;
89
89
}
90
90
else
91
91
{
92
92
fsb = sb . Connection ( null ) ;
93
- Assert . IsNull ( options . GetConnection ( ) , $ "{ sbType } : After call with null") ;
93
+ Assert . IsNull ( options . UserSuppliedConnection , $ "{ sbType } : After call with null") ;
94
94
Assert . AreEqual ( sb , fsb , $ "{ sbType } : Unexpected fluent return after call with null") ;
95
95
}
96
96
}
@@ -109,13 +109,13 @@ public void CanSetConnectionOnStateless()
109
109
try
110
110
{
111
111
var options = ( ISessionCreationOptions ) sb ;
112
- Assert . IsNull ( options . GetConnection ( ) , $ "{ sbType } : Initial value") ;
112
+ Assert . IsNull ( options . UserSuppliedConnection , $ "{ sbType } : Initial value") ;
113
113
var fsb = sb . Connection ( conn ) ;
114
- Assert . AreEqual ( conn , options . GetConnection ( ) , $ "{ sbType } : After call with a connection") ;
114
+ Assert . AreEqual ( conn , options . UserSuppliedConnection , $ "{ sbType } : After call with a connection") ;
115
115
Assert . AreEqual ( sb , fsb , $ "{ sbType } : Unexpected fluent return after call with a connection") ;
116
116
117
117
fsb = sb . Connection ( null ) ;
118
- Assert . IsNull ( options . GetConnection ( ) , $ "{ sbType } : After call with null") ;
118
+ Assert . IsNull ( options . UserSuppliedConnection , $ "{ sbType } : After call with null") ;
119
119
Assert . AreEqual ( sb , fsb , $ "{ sbType } : Unexpected fluent return after call with null") ;
120
120
}
121
121
finally
@@ -138,7 +138,7 @@ public void CanSetConnectionReleaseMode()
138
138
private void CanSetConnectionReleaseMode < T > ( T sb ) where T : ISessionBuilder < T >
139
139
{
140
140
var options = ( ISessionCreationOptions ) sb ;
141
- CanSet ( sb , sb . ConnectionReleaseMode , options . GetConnectionReleaseMode ,
141
+ CanSet ( sb , sb . ConnectionReleaseMode , ( ) => options . SessionConnectionReleaseMode ,
142
142
sb is ISharedSessionBuilder ssb ? ssb . ConnectionReleaseMode : default ( Func < ISharedSessionBuilder > ) ,
143
143
// initial values
144
144
sessions . Settings . ConnectionReleaseMode ,
@@ -160,7 +160,7 @@ public void CanSetFlushMode()
160
160
private void CanSetFlushMode < T > ( T sb ) where T : ISessionBuilder < T >
161
161
{
162
162
var options = ( ISessionCreationOptions ) sb ;
163
- CanSet ( sb , sb . FlushMode , options . GetInitialSessionFlushMode ,
163
+ CanSet ( sb , sb . FlushMode , ( ) => options . InitialSessionFlushMode ,
164
164
sb is ISharedSessionBuilder ssb ? ssb . FlushMode : default ( Func < ISharedSessionBuilder > ) ,
165
165
// initial values
166
166
sessions . Settings . DefaultFlushMode ,
@@ -186,22 +186,22 @@ private void CanSetInterceptor<T>(T sb) where T : ISessionBuilder<T>
186
186
var interceptor = new EmptyInterceptor ( ) ;
187
187
var options = ( ISessionCreationOptions ) sb ;
188
188
189
- Assert . AreEqual ( sessions . Interceptor , options . GetInterceptor ( ) , $ "{ sbType } : Initial value") ;
189
+ Assert . AreEqual ( sessions . Interceptor , options . SessionInterceptor , $ "{ sbType } : Initial value") ;
190
190
var fsb = sb . Interceptor ( interceptor ) ;
191
- Assert . AreEqual ( interceptor , options . GetInterceptor ( ) , $ "{ sbType } : After call with an interceptor") ;
191
+ Assert . AreEqual ( interceptor , options . SessionInterceptor , $ "{ sbType } : After call with an interceptor") ;
192
192
Assert . AreEqual ( sb , fsb , $ "{ sbType } : Unexpected fluent return after call with an interceptor") ;
193
193
194
194
if ( sb is ISharedSessionBuilder ssb )
195
195
{
196
196
var fssb = ssb . Interceptor ( ) ;
197
- Assert . AreEqual ( EmptyInterceptor . Instance , options . GetInterceptor ( ) , $ "{ sbType } : After call with shared interceptor") ;
197
+ Assert . AreEqual ( EmptyInterceptor . Instance , options . SessionInterceptor , $ "{ sbType } : After call with shared interceptor") ;
198
198
Assert . AreEqual ( sb , fssb , $ "{ sbType } : Unexpected fluent return on shared") ;
199
199
}
200
200
201
201
Assert . Throws < ArgumentNullException > ( ( ) => sb . Interceptor ( null ) , $ "{ sbType } : After call with null") ;
202
202
203
203
fsb = sb . NoInterceptor ( ) ;
204
- Assert . AreEqual ( EmptyInterceptor . Instance , options . GetInterceptor ( ) , $ "{ sbType } : After no call") ;
204
+ Assert . AreEqual ( EmptyInterceptor . Instance , options . SessionInterceptor , $ "{ sbType } : After no call") ;
205
205
Assert . AreEqual ( sb , fsb , $ "{ sbType } : Unexpected fluent return after no call") ;
206
206
}
207
207
0 commit comments