public void SetUp() { EnvironmentHelper.AssertDb2ClientIsInstalled(); DatabaseProviderFactory factory = new DatabaseProviderFactory(Db2TestConfigurationSource.CreateConfigurationSource()); db = factory.Create("Db2Test"); }
protected override void Arrange() { EnvironmentHelper.AssertDb2ClientIsInstalled(); DatabaseProviderFactory factory = new DatabaseProviderFactory(Db2TestConfigurationSource.CreateConfigurationSource()); database = factory.Create("Db2Test") as Db2Database; }
public void TestInitialize() { EnvironmentHelper.AssertDb2ClientIsInstalled(); DatabaseProviderFactory factory = new DatabaseProviderFactory(Db2TestConfigurationSource.CreateConfigurationSource()); db = factory.Create("Db2Test"); baseFixture = new DataAccessTestsFixture(db); }
public void SetUp() { EnvironmentHelper.AssertDb2ClientIsInstalled(); DatabaseProviderFactory factory = new DatabaseProviderFactory(Db2TestConfigurationSource.CreateConfigurationSource()); db = factory.Create("Db2Test"); DbCommand command = db.GetSqlStringCommand("Select count(*) from region"); baseFixture = new ExecuteScalarFixture(db, command); }
public void SetUp() { EnvironmentHelper.AssertDb2ClientIsInstalled(); DatabaseProviderFactory factory = new DatabaseProviderFactory(Db2TestConfigurationSource.CreateConfigurationSource()); db = factory.Create("Db2Test"); DbCommand insertionCommand = db.GetSqlStringCommand(insertString); DbCommand countCommand = db.GetSqlStringCommand(countQuery); baseFixture = new ExecuteNonQueryFixture(db, insertString, countQuery, insertionCommand, countCommand); }
public void Initialize() { EnvironmentHelper.AssertDb2ClientIsInstalled(); DatabaseProviderFactory factory = new DatabaseProviderFactory(Db2TestConfigurationSource.CreateConfigurationSource()); db = factory.Create("Db2Test"); try { DeleteStoredProcedures(); } catch { } CreateStoredProcedures(); base.SetUp(); }
public void TestInitialize() { EnvironmentHelper.AssertDb2ClientIsInstalled(); DatabaseProviderFactory factory = new DatabaseProviderFactory(Db2TestConfigurationSource.CreateConfigurationSource()); db = factory.Create("Db2Test"); storedProcedure = db.GetStoredProcCommand("GetCustomerTest"); connection = db.CreateConnection(); connection.Open(); storedProcedure.Connection = connection; cache = new ParameterCache(); baseFixture = new ParameterDiscoveryFixture(storedProcedure); }
public void SetUp() { DatabaseProviderFactory factory = new DatabaseProviderFactory(Db2TestConfigurationSource.CreateConfigurationSource()); db = factory.Create("Db2Test"); try { DeleteStoredProcedures(); } catch {} CreateStoredProcedures(); baseFixture = new TransactionScopeFixture(db); baseFixture.Cleanup(); }
public void CanInsertNullStringParameter() { DatabaseProviderFactory factory = new DatabaseProviderFactory(Db2TestConfigurationSource.CreateConfigurationSource()); Database db = factory.Create("Db2Test"); using (DbConnection connection = db.CreateConnection()) { connection.Open(); using (DbTransaction transaction = connection.BeginTransaction()) { string sqlString = "insert into Customers (CustomerID, CompanyName, ContactName) Values (@id, @name, @contact)"; DbCommand insert = db.GetSqlStringCommand(sqlString); db.AddInParameter(insert, "@id", DbType.Int32, 1); db.AddInParameter(insert, "@name", DbType.String, "fee"); db.AddInParameter(insert, "@contact", DbType.String, null); db.ExecuteNonQuery(insert, transaction); transaction.Rollback(); } } }
public void SetUp() { EnvironmentHelper.AssertDb2ClientIsInstalled(); configurationSource = Db2TestConfigurationSource.CreateConfigurationSource(); }