@@ -42,7 +42,7 @@ public void Instance_should_return_the_same_instance_every_time()
42
42
public void GetOrCreateCluster_should_return_a_cluster_with_the_correct_settings ( )
43
43
{
44
44
var credentials = new [ ] { MongoCredential . CreateMongoCRCredential ( "source" , "username" , "password" ) } ;
45
- var servers = new [ ] { new MongoServerAddress ( "localhost" ) } ;
45
+ var servers = new [ ] { new MongoServerAddress ( "localhost" ) , new MongoServerAddress ( "127.0.0.1" , 30000 ) , new MongoServerAddress ( "[::1]" , 27018 ) } ;
46
46
47
47
var sslSettings = new SslSettings
48
48
{
@@ -76,16 +76,19 @@ public void GetOrCreateCluster_should_return_a_cluster_with_the_correct_settings
76
76
77
77
using ( var cluster = subject . GetOrCreateCluster ( clientSettings . ToClusterKey ( ) ) )
78
78
{
79
- var address = clientSettings . Servers . Single ( ) ;
80
- var endPoints = new [ ] { new DnsEndPoint ( address . Host , address . Port ) } ;
79
+ var endPoints = new EndPoint [ ]
80
+ {
81
+ new DnsEndPoint ( "localhost" , 27017 ) ,
82
+ new IPEndPoint ( IPAddress . Parse ( "127.0.0.1" ) , 30000 ) ,
83
+ new IPEndPoint ( IPAddress . Parse ( "[::1]" ) , 27018 )
84
+ } ;
81
85
cluster . Settings . ConnectionMode . Should ( ) . Be ( ClusterConnectionMode . ReplicaSet ) ;
82
86
cluster . Settings . EndPoints . Equals ( endPoints ) ;
83
87
cluster . Settings . ReplicaSetName . Should ( ) . Be ( "rs" ) ;
84
88
cluster . Settings . PostServerSelector . Should ( ) . NotBeNull ( ) . And . Subject . Should ( ) . BeOfType < LatencyLimitingServerSelector > ( ) ;
85
89
cluster . Settings . MaxServerSelectionWaitQueueSize . Should ( ) . Be ( 20 ) ;
86
90
87
- var serverDescription = cluster . Description . Servers . Single ( s => s . EndPoint . Equals ( endPoints [ 0 ] ) ) ;
88
- serverDescription . EndPoint . Should ( ) . Be ( endPoints [ 0 ] ) ;
91
+ cluster . Description . Servers . Select ( s => s . EndPoint ) . Should ( ) . Contain ( endPoints ) ;
89
92
90
93
// TODO: don't know how to test the rest of the settings because they are all private to the cluster
91
94
}
0 commit comments