public void RegisterOracleDbContext_Requires_Config() { // arrange var cb = new ContainerBuilder(); // act & assert Assert.Throws <ArgumentNullException>(() => OracleDbContextContainerBuilderExtensions.RegisterDbContext <GoodOracleDbContextcs>(cb, null)); }
public void RegisterOracleDbContext_Requires_Builder() { // arrange IConfiguration config = new ConfigurationBuilder().Build(); // act & assert Assert.Throws <ArgumentNullException>(() => OracleDbContextContainerBuilderExtensions.RegisterDbContext <GoodOracleDbContextcs>(null, config)); }
public void RegisterOracleDbContext_AddsToContainer() { // arrange var container = new ContainerBuilder(); IConfiguration config = new ConfigurationBuilder().Build(); // act _ = OracleDbContextContainerBuilderExtensions.RegisterDbContext <GoodOracleDbContextcs>(container, config); var services = container.Build(); var dbConn = services.Resolve <GoodOracleDbContextcs>(); // assert Assert.NotNull(dbConn); Assert.IsType <GoodOracleDbContextcs>(dbConn); }