コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }