@@ -21,7 +21,7 @@ public async Task PostgresqlTableExistScriptTest_Success()
2121 {
2222 new DatabaseScript (
2323 "mytable" ,
24- $@ "SELECT EXISTS (SELECT * FROM information_schema. tables WHERE table_name = 'mytable');",
24+ $@ "SELECT EXISTS(SELECT * FROM "" information_schema""."" tables"" WHERE "" table_name"" = 'mytable');",
2525 DatabaseTestType . ObjectExist ,
2626 DatabaseKind . PostgreSQL )
2727 } . ToExpectedObject ( ) ;
@@ -42,7 +42,7 @@ public async Task PostgresqlViewExistScriptTest_Success()
4242 {
4343 new DatabaseScript (
4444 "myview" ,
45- $@ "SELECT EXISTS (SELECT * FROM information_schema. views WHERE table_name = 'myview');",
45+ $@ "SELECT EXISTS(SELECT * FROM "" information_schema""."" views"" WHERE "" table_name"" = 'myview');",
4646 DatabaseTestType . ObjectExist ,
4747 DatabaseKind . PostgreSQL )
4848 } . ToExpectedObject ( ) ;
@@ -63,7 +63,7 @@ public async Task PostgresqlStoredProcedureExistScriptTest_Success()
6363 {
6464 new DatabaseScript (
6565 "mystoredprocedure" ,
66- $@ "SELECT EXISTS (SELECT * FROM information_schema. routines WHERE routine_name = 'mystoredprocedure');",
66+ $@ "SELECT EXISTS(SELECT * FROM "" information_schema""."" routines"" WHERE "" routine_name"" = 'mystoredprocedure');",
6767 DatabaseTestType . ObjectExist ,
6868 DatabaseKind . PostgreSQL )
6969 } . ToExpectedObject ( ) ;
@@ -84,12 +84,12 @@ public async Task PostgresqlMultipleTableExistScriptTest_Success()
8484 {
8585 new DatabaseScript (
8686 "table1" ,
87- $@ "SELECT EXISTS (SELECT * FROM information_schema. tables WHERE table_name = 'table1');",
87+ $@ "SELECT EXISTS(SELECT * FROM "" information_schema""."" tables"" WHERE "" table_name"" = 'table1');",
8888 DatabaseTestType . ObjectExist ,
8989 DatabaseKind . PostgreSQL ) ,
9090 new DatabaseScript (
9191 "table2" ,
92- $@ "SELECT EXISTS (SELECT * FROM information_schema. tables WHERE table_name = 'table2');",
92+ $@ "SELECT EXISTS(SELECT * FROM "" information_schema""."" tables"" WHERE "" table_name"" = 'table2');",
9393 DatabaseTestType . ObjectExist ,
9494 DatabaseKind . PostgreSQL )
9595 } . ToExpectedObject ( ) ;
@@ -110,12 +110,12 @@ public async Task PostgresqlMultipleViewExistScriptTest_Success()
110110 {
111111 new DatabaseScript (
112112 "view1" ,
113- $@ "SELECT EXISTS (SELECT * FROM information_schema. views WHERE table_name = 'view1');",
113+ $@ "SELECT EXISTS(SELECT * FROM "" information_schema""."" views"" WHERE "" table_name"" = 'view1');",
114114 DatabaseTestType . ObjectExist ,
115115 DatabaseKind . PostgreSQL ) ,
116116 new DatabaseScript (
117117 "view2" ,
118- $@ "SELECT EXISTS (SELECT * FROM information_schema. views WHERE table_name = 'view2');",
118+ $@ "SELECT EXISTS(SELECT * FROM "" information_schema""."" views"" WHERE "" table_name"" = 'view2');",
119119 DatabaseTestType . ObjectExist ,
120120 DatabaseKind . PostgreSQL )
121121 } . ToExpectedObject ( ) ;
@@ -136,12 +136,12 @@ public async Task PostgresqlMultipleStoredProcedureExistScriptTest_Success()
136136 {
137137 new DatabaseScript (
138138 "sp1" ,
139- $@ "SELECT EXISTS (SELECT * FROM information_schema. routines WHERE routine_name = 'sp1');",
139+ $@ "SELECT EXISTS(SELECT * FROM "" information_schema""."" routines"" WHERE "" routine_name"" = 'sp1');",
140140 DatabaseTestType . ObjectExist ,
141141 DatabaseKind . PostgreSQL ) ,
142142 new DatabaseScript (
143143 "sp2" ,
144- $@ "SELECT EXISTS (SELECT * FROM information_schema. routines WHERE routine_name = 'sp2');",
144+ $@ "SELECT EXISTS(SELECT * FROM "" information_schema""."" routines"" WHERE "" routine_name"" = 'sp2');",
145145 DatabaseTestType . ObjectExist ,
146146 DatabaseKind . PostgreSQL )
147147 } . ToExpectedObject ( ) ;
@@ -167,12 +167,14 @@ public async Task PostgresqlRecordExistScriptTest_Success()
167167 var generator = new PostgresqlTestGenerator ( options =>
168168 {
169169 options . AddDatabaseRecordExitsRule (
170- new List < DatabaseRule > ( )
170+ new List < DatabaseRecordExistRule > ( )
171171 {
172- new DatabaseRule ( )
172+ new DatabaseRecordExistRule ( )
173173 {
174174 TableName = "mytable" ,
175- PredicateValue = "name = 'myname'"
175+ ColumnName = "name" ,
176+ Operator = "=" ,
177+ Value = "myname"
176178 }
177179 } ) ;
178180 } ) ;
@@ -181,7 +183,7 @@ public async Task PostgresqlRecordExistScriptTest_Success()
181183 {
182184 new DatabaseScript (
183185 "mytable" ,
184- $@ "SELECT EXISTS (SELECT 1 FROM mytable WHERE name = 'myname');",
186+ $@ "SELECT EXISTS(SELECT * FROM "" mytable"" WHERE "" name"" = 'myname');",
185187 DatabaseTestType . RecordExist ,
186188 DatabaseKind . PostgreSQL )
187189 } . ToExpectedObject ( ) ;
@@ -196,12 +198,13 @@ public async Task PostgresqlRecordCountScriptTest_Success()
196198 var generator = new PostgresqlTestGenerator ( options =>
197199 {
198200 options . AddDatabaseRecordsCountRule (
199- new List < DatabaseRule > ( )
201+ new List < DatabaseRecordCountRule > ( )
200202 {
201- new DatabaseRule ( )
203+ new DatabaseRecordCountRule ( )
202204 {
203205 TableName = "mytable" ,
204- PredicateValue = "=100"
206+ Operator = "=" ,
207+ Count = 100
205208 }
206209 } ) ;
207210 } ) ;
@@ -210,7 +213,7 @@ public async Task PostgresqlRecordCountScriptTest_Success()
210213 {
211214 new DatabaseScript (
212215 "mytable" ,
213- $@ "SELECT EXISTS (SELECT 1 FROM mytable WHERE (SELECT count (*) FROM mytable)= 100);",
216+ $@ "SELECT EXISTS (SELECT * FROM "" mytable"" WHERE (SELECT COUNT (*) AS ""count"" FROM "" mytable"") = 100);",
214217 DatabaseTestType . RecordCount ,
215218 DatabaseKind . PostgreSQL )
216219 } . ToExpectedObject ( ) ;
0 commit comments