File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/Microsoft.Data.SqlClient/tests/FunctionalTests Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,9 @@ public class SqlConnectionBasicTests
3030 public static PropertyInfo serverProvidedFailoverPartnerProperty = sqlInternalConnectionTds . GetProperty ( "ServerProvidedFailoverPartner" , BindingFlags . NonPublic | BindingFlags . Instance ) ;
3131 public static Type localAppContextSwitches = systemData . GetType ( "Microsoft.Data.SqlClient.LocalAppContextSwitches" ) ;
3232 public static FieldInfo ignoreServerProvidedFailoverPartnerField = localAppContextSwitches . GetField ( "s_ignoreServerProvidedFailoverPartner" , BindingFlags . NonPublic | BindingFlags . Static ) ;
33+ public static Type tristateEnum = localAppContextSwitches . GetNestedType ( "Tristate" , BindingFlags . NonPublic ) ;
34+ public static object tristateTrue = Enum . Parse ( tristateEnum , "True" ) ;
35+ public static object tristateFalse = Enum . Parse ( tristateEnum , "False" ) ;
3336
3437
3538 [ Fact ]
@@ -311,7 +314,7 @@ public void ConnectionTestValidCredentialCombination()
311314 public void TransientFault_IgnoreServerProvidedFailoverPartner_ShouldConnectToUserProvidedPartner ( )
312315 {
313316 // Arrange
314- ignoreServerProvidedFailoverPartnerField . SetValue ( null , ) ;
317+ ignoreServerProvidedFailoverPartnerField . SetValue ( null , tristateTrue ) ;
315318
316319
317320 try
@@ -373,7 +376,7 @@ public void TransientFault_IgnoreServerProvidedFailoverPartner_ShouldConnectToUs
373376 }
374377 finally
375378 {
376- ignoreServerProvidedFailoverPartnerField . SetValue ( null , false ) ;
379+ ignoreServerProvidedFailoverPartnerField . SetValue ( null , tristateFalse ) ;
377380 }
378381 }
379382
You can’t perform that action at this time.
0 commit comments