public void RegisterFactoryWithWrongTypeTest() { ClearRegisteredFactories(); Assert.Throws <ArgumentException>(() => DbProviderFactories.GetFactory("System.Data.SqlClient")); Assert.Throws <ArgumentException>(() => DbProviderFactories.RegisterFactory("System.Data.SqlClient", typeof(System.Data.SqlClient.SqlConnection))); }
public void RegisterFactoryWithInstanceTest() { ClearRegisteredFactories(); RegisterSqlClientAndTestRegistration(() => DbProviderFactories.RegisterFactory("System.Data.SqlClient", System.Data.SqlClient.SqlClientFactory.Instance)); }
public void RegisterFactoryWithAssemblyQualifiedNameTest() { ClearRegisteredFactories(); RegisterSqlClientAndTestRegistration(() => DbProviderFactories.RegisterFactory("System.Data.SqlClient", typeof(System.Data.SqlClient.SqlClientFactory).AssemblyQualifiedName)); }
public void RegisterFactoryWithTypeTest() { ClearRegisteredFactories(); RegisterSqlClientAndTestRegistration(() => DbProviderFactories.RegisterFactory("System.Data.SqlClient", typeof(System.Data.SqlClient.SqlClientFactory))); }
public void RegisterFactoryWithBadInvariantNameTest() { ClearRegisteredFactories(); Assert.Throws <ArgumentException>(() => DbProviderFactories.GetFactory("System.Data.SqlClient")); Assert.Throws <ArgumentException>(() => DbProviderFactories.RegisterFactory(string.Empty, typeof(System.Data.SqlClient.SqlClientFactory))); }