1- using StackExchange . Redis . Configuration ;
1+ using Microsoft . Extensions . Logging . Abstractions ;
2+ using StackExchange . Redis . Configuration ;
23using System ;
34using System . Globalization ;
45using System . IO ;
56using System . IO . Pipelines ;
67using System . Linq ;
78using System . Net ;
89using System . Net . Sockets ;
10+ using System . Reflection ;
911using System . Security . Authentication ;
1012using System . Text ;
13+ using System . Text . RegularExpressions ;
1114using System . Threading ;
1215using System . Threading . Tasks ;
13- using Microsoft . Extensions . Logging . Abstractions ;
1416using Xunit ;
1517using Xunit . Abstractions ;
1618
@@ -25,6 +27,33 @@ public ConfigTests(ITestOutputHelper output, SharedConnectionFixture fixture) :
2527 public Version DefaultVersion = new ( 3 , 0 , 0 ) ;
2628 public Version DefaultAzureVersion = new ( 4 , 0 , 0 ) ;
2729
30+ [ Fact ]
31+ public void ExpectedFields ( )
32+ {
33+ // if this test fails: check that you've updated ConfigurationOptions.Clone(), then: fix the test!
34+ // this is simple but pragmatic "have you considered?" check
35+
36+ var fields = Array . ConvertAll ( typeof ( ConfigurationOptions ) . GetFields ( BindingFlags . Public | BindingFlags . NonPublic | BindingFlags . Instance ) ,
37+ x => Regex . Replace ( x . Name , """<(\w+)>k__BackingField""" , "$1" ) ) ;
38+ Array . Sort ( fields ) ;
39+ Assert . Equal ( new [ ] {
40+ "abortOnConnectFail" , "allowAdmin" , "asyncTimeout" , "backlogPolicy" , "BeforeSocketConnect" ,
41+ "CertificateSelection" , "CertificateValidation" , "ChannelPrefix" ,
42+ "checkCertificateRevocation" , "ClientName" , "commandMap" ,
43+ "configChannel" , "configCheckSeconds" , "connectRetry" ,
44+ "connectTimeout" , "DefaultDatabase" , "defaultOptions" ,
45+ "defaultVersion" , "EndPoints" , "heartbeatConsistencyChecks" ,
46+ "heartbeatInterval" , "includeDetailInExceptions" , "includePerformanceCountersInExceptions" ,
47+ "keepAlive" , "LibraryName" , "loggerFactory" ,
48+ "password" , "Protocol" , "proxy" ,
49+ "reconnectRetryPolicy" , "resolveDns" , "responseTimeout" ,
50+ "ServiceName" , "setClientLibrary" , "SocketManager" ,
51+ "ssl" , "sslHost" , "SslProtocols" ,
52+ "syncTimeout" , "tieBreaker" , "Tunnel" ,
53+ "user"
54+ } , fields ) ;
55+ }
56+
2857 [ Fact ]
2958 public void SslProtocols_SingleValue ( )
3059 {
0 commit comments