Esempio n. 1
0
        public void GetConnectionForTwoFilesAddsTwoConnectionsToPool()
        {
            TestConnectionString file1 = new TestConnectionString();
            TestConnectionString file2 = new TestConnectionString("test2.sdf");

            file2.CopyFile();
            SqlCeDatabase db1 = new SqlCeDatabase(file1.ConnectionString);
            SqlCeDatabase db2 = new SqlCeDatabase(file2.ConnectionString);

            using (DbConnection connection1 = SqlCeConnectionPool.CreateConnection(db1))
            {
                using (DbConnection connection2 = SqlCeConnectionPool.CreateConnection(db2)) {}
            }
            Assert.AreEqual(2, TestableSqlCeConnectionPool.PoolSize);
            SqlCeConnectionPool.CloseSharedConnections();
            file2.DeleteFile();
        }
Esempio n. 2
0
 public void TearDown()
 {
     SqlCeConnectionPool.CloseSharedConnections();
     testConnection = new TestConnectionString();
     testConnection.DeleteFile();
 }
Esempio n. 3
0
 public void DeleteDb()
 {
     SqlCeConnectionPool.CloseSharedConnections();
     testConnection.DeleteFile();
 }
 public void CloseConnections()
 {
     SqlCeConnectionPool.CloseSharedConnections();
     TestConnectionString testConnection = new TestConnectionString();
     testConnection.DeleteFile();
 }
        public void GetConnectionForTwoFilesAddsTwoConnectionsToPool()
        {
            TestConnectionString file1 = new TestConnectionString();
            TestConnectionString file2 = new TestConnectionString("test2.sdf");
            file2.CopyFile();

            SqlCeDatabase db1 = new SqlCeDatabase(file1.ConnectionString);
            SqlCeDatabase db2 = new SqlCeDatabase(file2.ConnectionString);

            using (DatabaseConnectionWrapper connection1 = SqlCeConnectionPool.CreateConnection(db1))
            {
                using (DatabaseConnectionWrapper connection2 = SqlCeConnectionPool.CreateConnection(db2)) {}
            }
            Assert.AreEqual(2, TestableSqlCeConnectionPool.PoolSize);

            SqlCeConnectionPool.CloseSharedConnections();
            file2.DeleteFile();
        }
 public void TearDown()
 {
     SqlCeConnectionPool.CloseSharedConnections();
     TestConnectionString test = new TestConnectionString();
     test.DeleteFile();
 }