public async Task GetVersions_SpecificVersion_UriWithQueryString() { MongoDbVersionResolver resolver = new MongoDbVersionResolver(new StaticConnectionStringProvider($"mongodb://{ Constants.SpecificMongoHostname }:27017/?w=1"), 10000, 10000); var versions = await resolver.GetVersions().ConfigureAwait(false); Assert.Equal(1, versions.Count()); Assert.Equal(versions.First(), DependencyVersion.Parse(Constants.SpecificMongoVersion)); }
public async Task GetVersions_ConnectionStringNotFound() { IVersionResolver resolver = new MongoDbVersionResolver(new DummyNotFoundConnectionStringProvider(), 10, 10); await Assert.ThrowsAsync <ConnectionStringNotFoundException>(async() => { var value = await resolver.GetVersions().ConfigureAwait(false); }); }
public async Task GetVersions_LatestVersion() { MongoDbVersionResolver resolver = new MongoDbVersionResolver(new StaticConnectionStringProvider($"mongodb://{ Constants.LatestMongoHostname }:27017"), 10000, 10000); var versions = await resolver.GetVersions().ConfigureAwait(false); Assert.Equal(1, versions.Count()); Assert.True(versions.First() >= DependencyVersion.Parse("3.0.0")); }