コード例 #1
0
        public async Task GetVersions_ConnectionStringNotFound()
        {
            IVersionResolver resolver = new RabbitMqVersionResolver(new DummyNotFoundConnectionStringProvider(), 10000, 10000);

            await Assert.ThrowsAsync <ConnectionStringNotFoundException>(async() =>
            {
                var value = await resolver.GetVersions().ConfigureAwait(false);
            });
        }
コード例 #2
0
        public async Task GetVersions_MultipleConnectionStrings()
        {
            string           connectionString = $"amqp://*****:*****@{ Constants.SpecificRabbitHostname }:5672/, amqp://gibberish:notneeded@{ Constants.LatestRabbitHostname }:5672/";
            IVersionResolver resolver         = new RabbitMqVersionResolver(new StaticConnectionStringProvider(connectionString), 10000, 10000);

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

            Assert.Equal(2, versions.Count());
            Assert.Equal(versions.First(), DependencyVersion.Parse(Constants.SpecificRabbitVersion));
        }
コード例 #3
0
        public async Task GetVersions_LatestVersion()
        {
            string           connectionString = $"amqp://*****:*****@{ Constants.LatestRabbitHostname }:5672/";
            IVersionResolver resolver         = new RabbitMqVersionResolver(new StaticConnectionStringProvider(connectionString), 10000, 10000);

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

            Assert.Equal(1, versions.Count());
            Assert.True(versions.First() >= DependencyVersion.Parse("3.6.5"));
        }