Пример #1
0
        public async Task GetVersions_DependencyNotReachable()
        {
            IVersionResolver resolver = new ElasticsearchVersionResolver(new StaticConnectionStringProvider(""), 10, 10);

            await Assert.ThrowsAsync <DependencyNotReachableException>(async() =>
            {
                var value = await resolver.GetVersions().ConfigureAwait(false);
            });
        }
Пример #2
0
        public async Task GetVersions_ConnectionStringNotFound()
        {
            IVersionResolver resolver = new ElasticsearchVersionResolver(new DummyNotFoundConnectionStringProvider(), 10, 10);

            await Assert.ThrowsAsync <ConnectionStringNotFoundException>(async() =>
            {
                var value = await resolver.GetVersions().ConfigureAwait(false);
            });
        }
Пример #3
0
        public async Task GetVersions_SpecificVersion()
        {
            ElasticsearchVersionResolver resolver = new ElasticsearchVersionResolver(new StaticConnectionStringProvider($"http://{ Constants.SpecificElasticsearchHostname }:9200"), 10000, 10000);

            var versions = await resolver.GetVersions().ConfigureAwait(false);

            Assert.Equal(1, versions.Count());
            Assert.Equal(versions.First(), DependencyVersionParser.Parse(Constants.SpecificElasticsearchVersion, false));
        }
Пример #4
0
        public async Task GetVersions_LatestVersion()
        {
            ElasticsearchVersionResolver resolver = new ElasticsearchVersionResolver(new StaticConnectionStringProvider($"http://{ Constants.LatestElasticsearchHostname }:9200"), 10000, 10000);

            var versions = await resolver.GetVersions().ConfigureAwait(false);

            Assert.Equal(1, versions.Count());
            // Latest GA RELEASE: https://www.elastic.co/downloads/elasticsearch#ga-release
            Assert.Equal(versions.First(), DependencyVersionParser.Parse("5.6.3", false));
        }