public void DoubleDisposeDoesNotThrow()
        {
            var connection = new ElasticConnection(endpoint, UserName, Password);

            connection.Dispose();
            connection.Dispose();
        }
        public async Task DisposeKillsHttpClient()
        {
            var connection = new ElasticConnection(endpoint, UserName, Password);

            connection.Dispose();

            await Assert.ThrowsAsync <NullReferenceException>(() => connection.HttpClient.GetAsync(new Uri("http://something.com")));
        }
        public void DoubleDisposeDoesNotThrow()
        {
            var connection = new ElasticConnection(endpoint, UserName, Password);

            connection.Dispose();
            connection.Dispose();
        }
        public async Task DisposeKillsHttpClient()
        {
            var connection = new ElasticConnection(endpoint, UserName, Password);

            connection.Dispose();

            await Assert.ThrowsAsync<NullReferenceException>(() => connection.HttpClient.GetAsync(new Uri("http://something.com")));
        }