public void SetUp() { testConnection = new TestConnectionString(); testConnection.CopyFile(); db = new SqlCeDatabase(testConnection.ConnectionString); DbCommand command = db.GetSqlStringCommand("Select count(*) from region"); baseFixture = new ExecuteScalarFixture(db, command); }
public void ExecuteSqlCreatesConnectionInPool() { TestConnectionString testConnection = new TestConnectionString(); SqlCeDatabase db = new SqlCeDatabase(testConnection.ConnectionString); DbCommand command = db.GetSqlStringCommand("select count(*) from region"); Assert.AreEqual(0, TestableSqlCeConnectionPool.PoolSize); int result = (int)db.ExecuteScalar(command); Assert.AreEqual(4, result); Assert.AreEqual(1, TestableSqlCeConnectionPool.PoolSize); }