예제 #1
0
 static void RunAll(ConnectedTest test)
 {
     string[] providers = TestUtil.Providers;
     for (int i = 0; i < providers.Length; ++i)
     {
         Run(providers[i], test);
     }
 }
예제 #2
0
        static void Run(string databaseProvider, ConnectedTest test)
        {
            if (databaseProvider == null)
            {
                throw new ArgumentNullException("databaseProvider");
            }

            AppSettingsReader config           = new AppSettingsReader();
            string            connectionString = config.GetValue(databaseProvider,
                                                                 typeof(string)) as string;
            GlazeFactory glazeFactory = new GlazeFactory(databaseProvider);
            DbConnection connection   = glazeFactory.CreateConnection();

            connection.ConnectionString = connectionString;
            connection.Open();
            try
            {
                test(glazeFactory, connection);
            }
            finally
            {
                connection.Close();
            }
        }