1
1
Attribute VB_Name = "SQLUnitTests"
2
2
Public Function SQLlib_RunAllTests ()
3
+ SQLlib_RunAllTests = True
3
4
4
- RunAllModuleTests ("SQLlib_SQLDatabase" )
5
+ SQLlib_RunAllTests = SQLlib_RunAllTests And RunAllModuleTests ("SQLlib_SQLDatabase" )
5
6
6
- RunAllModuleTests ("SQLlib_SQLInsert" )
7
-
8
- RunAllModuleTests ("SQLlib_SQLSelect" )
7
+ SQLlib_RunAllTests = SQLlib_RunAllTests And RunAllModuleTests ("SQLlib_SQLInsert" )
8
+
9
+ SQLlib_RunAllTests = SQLlib_RunAllTests And RunAllModuleTests ("SQLlib_SQLSelect" )
9
10
10
- RunAllModuleTests ("SQLlib_SQLStatic" )
11
+ SQLlib_RunAllTests = SQLlib_RunAllTests And RunAllModuleTests ("SQLlib_SQLStatic" )
11
12
12
13
Dim Interfaced As iSQLQuery
13
14
'******************************Check Delete********************************
@@ -34,12 +35,6 @@ Public Function SQLlib_RunAllTests()
34
35
Set Interfaced = MyUpdate
35
36
AssertObjectStringEquals Interfaced, "UPDATE users SET username='admin'' WHERE id=1;DROP TABLE users;' WHERE id=1"
36
37
37
- '*******************Check SubSelect****************************************
38
- 'Dim MySubselect As New SQLSubselect
39
- 'Set MySubselect.SelectSQL = MyOtherSelect
40
- 'MySubselect.SelectAs = "user_id"
41
- 'CheckSQLValue MySubselect, "(SELECT id FROM users WHERE name='admin') AS user_id"
42
-
43
38
'*****************Check Create*****************
44
39
'Dim MyCreate As SQLCreate
45
40
'Set MyCreate = Create_SQLCreate
@@ -50,7 +45,13 @@ Public Function SQLlib_RunAllTests()
50
45
'Dim Interfaced As iSQLQuery
51
46
'Set Interfaced = MyCreate
52
47
'CheckSQLValue Interfaced, "CREATE TABLE users (id int, username varchar(50))"
53
-
48
+
49
+ '*******************Check SubSelect****************************************
50
+ 'Dim MySubselect As New SQLSubselect
51
+ 'Set MySubselect.SelectSQL = MyOtherSelect
52
+ 'MySubselect.SelectAs = "user_id"
53
+ 'CheckSQLValue MySubselect, "(SELECT id FROM users WHERE name='admin') AS user_id"
54
+
54
55
'****************Check Where Group*****************************************
55
56
'Dim MyWhereGroup As New SQLWhereGroup
56
57
'Dim MyOtherWhere As New SQLCondition
@@ -68,5 +69,4 @@ Public Function SQLlib_RunAllTests()
68
69
'MyOtherWhereGroup.SetGroup MyWhere, MyThirdWhere, "OR"
69
70
'MyWhereGroup.AddWhere MyOtherWhereGroup, "AND"
70
71
'CheckSQLValue MyWhereGroup, "((id=2 AND type='toys') OR color='pink') AND (id=2 OR color='pink')"
71
- SQLlib_RunAllTests = True
72
72
End Function
0 commit comments