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