Exemplo n.º 1
0
        public void CanCreateDbFactoryFromProviderName()
        {
            DbProviderFactory factory = DbObjectFactory.GetProviderFactory(_commonNamespace);

            //Needs to be a mysql client factory
            Assert.IsNotNull(factory);
            Assert.IsInstanceOf(typeof(CustomDbProviderFactory), factory);
        }
Exemplo n.º 2
0
        public override void Setup()
        {
            DbProviderFactories.RegisterFactory(_commonNamespace, CustomDbProviderFactory.Instance);

            //For regular .NET framework the driver must be installed in the Global Assembly Cache
            DataTable table = DbProviderFactories.GetFactoryClasses();
            DataRow   row   = (from a in table.Rows.Cast <DataRow>()
                               where a.ItemArray[2].ToString() == _commonNamespace
                               select a).FirstOrDefault();

            _factory = new DbObjectFactory(row);
        }
Exemplo n.º 3
0
 public override void Setup()
 {
     _factory = new DbObjectFactory(CustomDbProviderFactory.Instance);
 }
Exemplo n.º 4
0
 public void ThrowsArugementExceptionCantFindProvider()
 {
     Assert.Throws <ArgumentException>(() => DbObjectFactory.GetProviderFactory("ADO.Net.Client.Core"));
 }
Exemplo n.º 5
0
 public override void Setup()
 {
     _factory = new DbObjectFactory("ADO.Net.Client.Tests.Common");
 }
 public override void Setup()
 {
     _factory = new DbObjectFactory(new CustomDbConnection());
 }
Exemplo n.º 7
0
        public void Update(object obj)
        {
            var dbObject = new DbObjectFactory().ExecuteCreation(this.dbType, obj);

            this.dbConnection.Execute(dbObject.UpdateCommand());
        }