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); }); }
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); }); }
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)); }
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)); }