public void Should_return_empty_if_the_server_does_not_exist()
        {
            var subject = new EndPointServerSelector(new DnsEndPoint("blargh", 27017));

            var result = subject.SelectServers(_description, _description.Servers).ToList();

            result.Should().BeEmpty();
        }
        public void Should_select_no_servers_when_none_exist()
        {
            var subject = new EndPointServerSelector(new DnsEndPoint("blargh", 27017));

            var result = subject.SelectServers(_description, Enumerable.Empty<ServerDescription>()).ToList();

            result.Should().BeEmpty();
        }
Example #3
0
        public void Should_select_no_servers_when_none_exist()
        {
            var subject = new EndPointServerSelector(new DnsEndPoint("blargh", 27017));

            var result = subject.SelectServers(_description, Enumerable.Empty <ServerDescription>()).ToList();

            result.Should().BeEmpty();
        }
Example #4
0
        public void Should_return_empty_if_the_server_does_not_exist()
        {
            var subject = new EndPointServerSelector(new DnsEndPoint("blargh", 27017));

            var result = subject.SelectServers(_description, _description.Servers).ToList();

            result.Should().BeEmpty();
        }
        public void Should_select_the_server_if_it_exists()
        {
            var subject = new EndPointServerSelector(new DnsEndPoint("localhost", 27017));

            var result = subject.SelectServers(_description, _description.Servers).ToList();

            result.Count.Should().Be(1);
            result.Should().BeEquivalentTo(_description.Servers[0]);
        }
Example #6
0
        public void Should_select_the_server_if_it_exists()
        {
            var subject = new EndPointServerSelector(new DnsEndPoint("localhost", 27017));

            var result = subject.SelectServers(_description, _description.Servers).ToList();

            result.Count.Should().Be(1);
            result.Should().BeEquivalentTo(_description.Servers[0]);
        }
 private IServer GetServer()
 {
     var serverSelector = new EndPointServerSelector(_endPoint);
     var server = _cluster.SelectServer(serverSelector, CancellationToken.None);
     return server;
 }