public void AreSessionsSupported_should_return_expected_result(string clusterDescriptionJson, bool?expectedResult) { var subject = new MongoClient("mongodb://localhost"); var clusterDescription = ClusterDescriptionParser.Parse(clusterDescriptionJson); var result = subject.AreSessionsSupported(clusterDescription); result.Should().Be(expectedResult); }
public void SelectServers_should_return_all_servers_when_connection_mode_is_direct(string clusterDescriptionJson) { var subject = CreateSubject(); var cluster = ClusterDescriptionParser.Parse(clusterDescriptionJson); var connectedServers = cluster.Servers.Where(s => s.State == ServerState.Connected).ToList(); var result = subject.SelectServers(cluster, connectedServers); result.Should().Equal(connectedServers); }
public void SelectServers_should_set_ClusterDescription(string clusterDescriptionJson) { var subject = CreateSubject(); var cluster = ClusterDescriptionParser.Parse(clusterDescriptionJson); var connectedServers = cluster.Servers.Where(s => s.State == ServerState.Connected); var result = subject.SelectServers(cluster, connectedServers); AreSessionsSupportedServerSelectorReflector.ClusterDescription(subject).Should().BeSameAs(cluster); }