예제 #1
0
        public void AddOracleHealthContributor_ThrowsIfServiceNameNull()
        {
            IServiceCollection services    = new ServiceCollection();
            IConfigurationRoot config      = null;
            string             serviceName = null;

            var ex = Assert.Throws <ArgumentNullException>(() => OracleServiceCollectionExtensions.AddOracleHealthContributor(services, config, serviceName));

            Assert.Contains(nameof(serviceName), ex.Message);
        }
예제 #2
0
        public void AddOracleHealthContributor_AddsRelationalHealthContributor()
        {
            IServiceCollection services = new ServiceCollection();
            var builder = new ConfigurationBuilder();

            builder.AddCloudFoundry();
            var config = builder.Build();

            OracleServiceCollectionExtensions.AddOracleHealthContributor(services, config);
            var healthContributor = services.BuildServiceProvider().GetService <IHealthContributor>() as RelationalDbHealthContributor;

            Assert.NotNull(healthContributor);
        }
예제 #3
0
        public void AddOracleHealthContributor_ThrowsIfServiceCollectionNull()
        {
            IServiceCollection services = null;
            IConfigurationRoot config   = null;

            var ex = Assert.Throws <ArgumentNullException>(() => OracleServiceCollectionExtensions.AddOracleHealthContributor(services, config));

            Assert.Contains(nameof(services), ex.Message);

            var ex2 = Assert.Throws <ArgumentNullException>(() => OracleServiceCollectionExtensions.AddOracleHealthContributor(services, config, "foobar"));

            Assert.Contains(nameof(services), ex2.Message);
        }