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()
159159 [ Test ]
160160 public void TestInstance ( )
161161 {
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+ }
165168 }
166169
167170 [ Test ]
168171 public void TestInstances ( )
169172 {
170173 var instances = _server . Instances ;
171174 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+ }
174185 }
175186
176187 [ Test ]
@@ -288,7 +299,7 @@ public void TestRequestStartSlaveOkNested()
288299 [ Test ]
289300 public void TestSecondaries ( )
290301 {
291- Assert . AreEqual ( 0 , _server . Secondaries . Length ) ;
302+ Assert . IsTrue ( _server . Secondaries . Length < _server . Instances . Length ) ;
292303 }
293304
294305 [ Test ]
You can’t perform that action at this time.
0 commit comments