Exemplo n.º 1
0
        public void AddDbContext_ThrowsIfServiceNameNull()
        {
            IServiceCollection services    = new ServiceCollection();
            IConfigurationRoot config      = null;
            string             serviceName = null;

            var ex = Assert.Throws <ArgumentNullException>(() => OracleDbContextServiceCollectionExtensions.AddDbContext <GoodOracleDbContext>(services, config, serviceName));

            Assert.Contains(nameof(serviceName), ex.Message);
        }
Exemplo n.º 2
0
        public void AddDbContext_ThrowsIfServiceCollectionNull()
        {
            IServiceCollection services = null;
            IConfigurationRoot config   = null;

            var ex = Assert.Throws <ArgumentNullException>(() => OracleDbContextServiceCollectionExtensions.AddDbContext <GoodOracleDbContext>(services, config));

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

            var ex2 = Assert.Throws <ArgumentNullException>(() => OracleDbContextServiceCollectionExtensions.AddDbContext <GoodOracleDbContext>(services, config, "foobar"));

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