File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -159,18 +159,29 @@ public void TestGetDatabaseNames()
159
159
[ Test ]
160
160
public void TestInstance ( )
161
161
{
162
- var instance = _server . Instance ;
163
- Assert . IsNotNull ( instance ) ;
164
- Assert . IsTrue ( instance . IsPrimary ) ;
162
+ if ( _server . Instances . Length == 1 )
163
+ {
164
+ var instance = _server . Instance ;
165
+ Assert . IsNotNull ( instance ) ;
166
+ Assert . IsTrue ( instance . IsPrimary ) ;
167
+ }
165
168
}
166
169
167
170
[ Test ]
168
171
public void TestInstances ( )
169
172
{
170
173
var instances = _server . Instances ;
171
174
Assert . IsNotNull ( instances ) ;
172
- Assert . AreEqual ( 1 , instances . Length ) ;
173
- Assert . IsTrue ( instances [ 0 ] . IsPrimary ) ;
175
+
176
+ if ( instances . Length == 1 )
177
+ {
178
+ Assert . IsTrue ( instances [ 0 ] . IsPrimary ) ;
179
+ }
180
+ else
181
+ {
182
+ Assert . IsTrue ( instances . Length > 1 ) ;
183
+ Assert . AreEqual ( 1 , instances . Count ( i => i . IsPrimary ) ) ;
184
+ }
174
185
}
175
186
176
187
[ Test ]
@@ -288,7 +299,7 @@ public void TestRequestStartSlaveOkNested()
288
299
[ Test ]
289
300
public void TestSecondaries ( )
290
301
{
291
- Assert . AreEqual ( 0 , _server . Secondaries . Length ) ;
302
+ Assert . IsTrue ( _server . Secondaries . Length < _server . Instances . Length ) ;
292
303
}
293
304
294
305
[ Test ]
You can’t perform that action at this time.
0 commit comments