@@ -60,30 +60,47 @@ protected void CreateNewDatabase()
6060 ConnectionString = GetFileConnectionString ( ) ;
6161 }
6262
63+ enum DbType
64+ {
65+ Sqlite ,
66+ SqlServer ,
67+ PostgreSql ,
68+ MySql ,
69+ SqlServerMdf ,
70+ }
71+
6372 [ TestFixtureSetUp ]
6473 public void TestFixtureSetUp ( )
6574 {
6675 LogManager . LogFactory = new ConsoleLogFactory ( ) ;
6776
68- //OrmLiteConfig.DialectProvider = MySqlDialect.Provider;
69- //ConnectionString = "Server=localhost;Database=test;UID=root;Password=test";
70- //return;
71-
72- var useSqlite = true ;
73- if ( useSqlite )
74- {
75- OrmLiteConfig . DialectProvider = SqliteDialect . Provider ;
76- ConnectionString = GetFileConnectionString ( ) ;
77- ConnectionString = ":memory:" ;
78- }
79- else
80- {
81- OrmLiteConfig . DialectProvider = SqlServerDialect . Provider ;
82- ConnectionString = Config . SqlServerBuildDb ;
77+ //var dbType = DbType.Sqlite;
78+ var dbType = DbType . SqlServer ;
79+
80+ switch ( dbType )
81+ {
82+ case DbType . Sqlite :
83+ OrmLiteConfig . DialectProvider = SqliteDialect . Provider ;
84+ ConnectionString = GetFileConnectionString ( ) ;
85+ ConnectionString = ":memory:" ;
86+ return ;
87+ case DbType . SqlServer :
88+ OrmLiteConfig . DialectProvider = SqlServerDialect . Provider ;
89+ ConnectionString = Config . SqlServerBuildDb ;
90+ return ;
91+ case DbType . MySql :
92+ OrmLiteConfig . DialectProvider = MySqlDialect . Provider ;
93+ ConnectionString = "Server=localhost;Database=test;UID=root;Password=test" ;
94+ return ;
95+ case DbType . PostgreSql :
96+ OrmLiteConfig . DialectProvider = PostgreSqlDialect . Provider ;
97+ ConnectionString = Environment . GetEnvironmentVariable ( "PGSQL_TEST" ) ;
98+ return ;
99+ case DbType . SqlServerMdf :
100+ ConnectionString = "~/App_Data/Database1.mdf" . MapAbsolutePath ( ) ;
101+ ConnectionString = Config . GetDefaultConnection ( ) ;
102+ return ;
83103 }
84-
85- //ConnectionString = "~/App_Data/Database1.mdf".MapAbsolutePath();
86- //ConnectionString = Config.GetDefaultConnection();
87104 }
88105
89106 public void Log ( string text )
0 commit comments