public void GetFactoryNoRegistrationTest() { ClearRegisteredFactories(); Assert.Throws <ArgumentException>(() => DbProviderFactories.GetFactory("System.Data.SqlClient")); }
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 RegisterFactoryWithBadInvariantNameTest() { ClearRegisteredFactories(); Assert.Throws <ArgumentException>(() => DbProviderFactories.GetFactory("System.Data.SqlClient")); Assert.Throws <ArgumentException>(() => DbProviderFactories.RegisterFactory(string.Empty, typeof(System.Data.SqlClient.SqlClientFactory))); }