示例#1
0
        public void connect_to_unknown_hostname()
        {
            IRootInfoResponse result = null;

            Assert.DoesNotThrow(() =>
            {
                var settings = new ConnectionSettings(new Uri("http://youdontownthis.domain.do.you"), "index");
                var client   = new ElasticClient(settings);
                result       = client.RootNodeInfo();
            });
            Assert.False(result.IsValid);
            Assert.NotNull(result.ConnectionStatus);
        }
示例#2
0
        public void connect_to_unknown_hostname()
        {
            IRootInfoResponse result = null;

            //this test will fail if fiddler is enabled since the proxy
            //will report a statuscode of 502 instead of -1
            Assert.Throws <MaxRetryException>(() =>
            {
                var settings = new ConnectionSettings(new Uri("http://youdontownthis.domain.do.you"), "index");
                var client   = new ElasticClient(settings);
                result       = client.RootNodeInfo();
                Assert.False(result.IsValid);
                Assert.NotNull(result.ConnectionStatus);
            });
        }