5
5
using System . Threading . Tasks ;
6
6
using Xunit ;
7
7
8
- namespace QAToolKit . Engine . Database . Test
8
+ namespace QAToolKit . Engine . Database . Test . Generators
9
9
{
10
10
public class PostgresqlTestGeneratorTests
11
11
{
@@ -17,9 +17,9 @@ public async Task PostgresqlTableExistScriptTest_Success()
17
17
options . AddDatabaseObjectExitsRule ( new string [ ] { "mytable" } , DatabaseObjectType . Table ) ;
18
18
} ) ;
19
19
20
- var results = new List < DatabaseScript >
20
+ var results = new List < DatabaseTest >
21
21
{
22
- new DatabaseScript (
22
+ new DatabaseTest (
23
23
"mytable" ,
24
24
$@ "SELECT EXISTS(SELECT * FROM ""information_schema"".""tables"" WHERE ""table_name"" = 'mytable');",
25
25
DatabaseTestType . ObjectExist ,
@@ -38,9 +38,9 @@ public async Task PostgresqlViewExistScriptTest_Success()
38
38
options . AddDatabaseObjectExitsRule ( new string [ ] { "myview" } , DatabaseObjectType . View ) ;
39
39
} ) ;
40
40
41
- var results = new List < DatabaseScript >
41
+ var results = new List < DatabaseTest >
42
42
{
43
- new DatabaseScript (
43
+ new DatabaseTest (
44
44
"myview" ,
45
45
$@ "SELECT EXISTS(SELECT * FROM ""information_schema"".""views"" WHERE ""table_name"" = 'myview');",
46
46
DatabaseTestType . ObjectExist ,
@@ -59,9 +59,9 @@ public async Task PostgresqlStoredProcedureExistScriptTest_Success()
59
59
options . AddDatabaseObjectExitsRule ( new string [ ] { "mystoredprocedure" } , DatabaseObjectType . StoredProcedure ) ;
60
60
} ) ;
61
61
62
- var results = new List < DatabaseScript >
62
+ var results = new List < DatabaseTest >
63
63
{
64
- new DatabaseScript (
64
+ new DatabaseTest (
65
65
"mystoredprocedure" ,
66
66
$@ "SELECT EXISTS(SELECT * FROM ""information_schema"".""routines"" WHERE ""routine_name"" = 'mystoredprocedure');",
67
67
DatabaseTestType . ObjectExist ,
@@ -80,14 +80,14 @@ public async Task PostgresqlMultipleTableExistScriptTest_Success()
80
80
options . AddDatabaseObjectExitsRule ( new string [ ] { "table1" , "table2" } , DatabaseObjectType . Table ) ;
81
81
} ) ;
82
82
83
- var results = new List < DatabaseScript >
83
+ var results = new List < DatabaseTest >
84
84
{
85
- new DatabaseScript (
85
+ new DatabaseTest (
86
86
"table1" ,
87
87
$@ "SELECT EXISTS(SELECT * FROM ""information_schema"".""tables"" WHERE ""table_name"" = 'table1');",
88
88
DatabaseTestType . ObjectExist ,
89
89
DatabaseKind . PostgreSQL ) ,
90
- new DatabaseScript (
90
+ new DatabaseTest (
91
91
"table2" ,
92
92
$@ "SELECT EXISTS(SELECT * FROM ""information_schema"".""tables"" WHERE ""table_name"" = 'table2');",
93
93
DatabaseTestType . ObjectExist ,
@@ -106,14 +106,14 @@ public async Task PostgresqlMultipleViewExistScriptTest_Success()
106
106
options . AddDatabaseObjectExitsRule ( new string [ ] { "view1" , "view2" } , DatabaseObjectType . View ) ;
107
107
} ) ;
108
108
109
- var results = new List < DatabaseScript >
109
+ var results = new List < DatabaseTest >
110
110
{
111
- new DatabaseScript (
111
+ new DatabaseTest (
112
112
"view1" ,
113
113
$@ "SELECT EXISTS(SELECT * FROM ""information_schema"".""views"" WHERE ""table_name"" = 'view1');",
114
114
DatabaseTestType . ObjectExist ,
115
115
DatabaseKind . PostgreSQL ) ,
116
- new DatabaseScript (
116
+ new DatabaseTest (
117
117
"view2" ,
118
118
$@ "SELECT EXISTS(SELECT * FROM ""information_schema"".""views"" WHERE ""table_name"" = 'view2');",
119
119
DatabaseTestType . ObjectExist ,
@@ -132,14 +132,14 @@ public async Task PostgresqlMultipleStoredProcedureExistScriptTest_Success()
132
132
options . AddDatabaseObjectExitsRule ( new string [ ] { "sp1" , "sp2" } , DatabaseObjectType . StoredProcedure ) ;
133
133
} ) ;
134
134
135
- var results = new List < DatabaseScript >
135
+ var results = new List < DatabaseTest >
136
136
{
137
- new DatabaseScript (
137
+ new DatabaseTest (
138
138
"sp1" ,
139
139
$@ "SELECT EXISTS(SELECT * FROM ""information_schema"".""routines"" WHERE ""routine_name"" = 'sp1');",
140
140
DatabaseTestType . ObjectExist ,
141
141
DatabaseKind . PostgreSQL ) ,
142
- new DatabaseScript (
142
+ new DatabaseTest (
143
143
"sp2" ,
144
144
$@ "SELECT EXISTS(SELECT * FROM ""information_schema"".""routines"" WHERE ""routine_name"" = 'sp2');",
145
145
DatabaseTestType . ObjectExist ,
@@ -179,9 +179,9 @@ public async Task PostgresqlRecordExistScriptTest_Success()
179
179
} ) ;
180
180
} ) ;
181
181
182
- var results = new List < DatabaseScript >
182
+ var results = new List < DatabaseTest >
183
183
{
184
- new DatabaseScript (
184
+ new DatabaseTest (
185
185
"mytable" ,
186
186
$@ "SELECT EXISTS(SELECT * FROM ""mytable"" WHERE ""name"" = 'myname');",
187
187
DatabaseTestType . RecordExist ,
@@ -209,9 +209,9 @@ public async Task PostgresqlRecordCountScriptTest_Success()
209
209
} ) ;
210
210
} ) ;
211
211
212
- var results = new List < DatabaseScript >
212
+ var results = new List < DatabaseTest >
213
213
{
214
- new DatabaseScript (
214
+ new DatabaseTest (
215
215
"mytable" ,
216
216
$@ "SELECT EXISTS (SELECT * FROM ""mytable"" WHERE (SELECT COUNT(*) AS ""count"" FROM ""mytable"") = 100);",
217
217
DatabaseTestType . RecordCount ,
0 commit comments