|
1 | 1 | Attribute VB_Name = "SQLUnitTests"
|
2 | | -Public Function SQLlib_RunAllTests() |
3 | | - TestList = Array("SQLlib_SQLDatabase", "SQLlib_SQLInsert", "SQLlib_SQLSelect", "SQLlib_SQLStatic", "SQLlib_SQLDelete", "SQLlib_SQLUpdate") |
4 | | - SQLlib_RunAllTests = RunTestList(TestList) |
5 | | - |
6 | | - '*****************Check Create***************** |
7 | | - 'Dim MyCreate As SQLCreate |
8 | | - 'Set MyCreate = Create_SQLCreate |
9 | | - 'With MyCreate |
10 | | - ' .Table = "users" |
11 | | - ' .Fields = Array(Array("id", "int"), Array("username", "varchar", 50)) |
12 | | - 'End With |
13 | | - 'Dim Interfaced As iSQLQuery |
14 | | - 'Set Interfaced = MyCreate |
15 | | - 'CheckSQLValue Interfaced, "CREATE TABLE users (id int, username varchar(50))" |
16 | | - |
17 | | - '*******************Check SubSelect**************************************** |
18 | | - 'Dim MySubselect As New SQLSubselect |
19 | | - 'Set MySubselect.SelectSQL = MyOtherSelect |
20 | | - 'MySubselect.SelectAs = "user_id" |
21 | | - 'CheckSQLValue MySubselect, "(SELECT id FROM users WHERE name='admin') AS user_id" |
22 | | - |
23 | | - '****************Check Where Group***************************************** |
24 | | - 'Dim MyWhereGroup As New SQLWhereGroup |
25 | | - 'Dim MyOtherWhere As New SQLCondition |
26 | | - 'MyOtherWhere.Create "type", "'toys'" |
27 | | - 'MyWhereGroup.SetGroup MyWhere, MyOtherWhere, "AND" |
28 | | - 'CheckSQLValue MyWhereGroup, "id=2 AND type='toys'" |
29 | | - |
30 | | - 'Dim MyThirdWhere As New SQLCondition |
31 | | - 'MyThirdWhere.Create "color", "'pink'" |
32 | | - |
33 | | - 'MyWhereGroup.AddWhere MyThirdWhere, "OR" |
34 | | - 'CheckSQLValue MyWhereGroup, "(id=2 AND type='toys') OR color='pink'" |
35 | | - |
36 | | - 'Dim MyOtherWhereGroup As New SQLWhereGroup |
37 | | - 'MyOtherWhereGroup.SetGroup MyWhere, MyThirdWhere, "OR" |
38 | | - 'MyWhereGroup.AddWhere MyOtherWhereGroup, "AND" |
39 | | - 'CheckSQLValue MyWhereGroup, "((id=2 AND type='toys') OR color='pink') AND (id=2 OR color='pink')" |
40 | | - |
| 2 | +Public Function RunTests() |
| 3 | + Dim TestConfig As iTestableProject |
| 4 | + Dim SQLLibTestConfig As New SQLlibTests |
| 5 | + Set TestConfig = SQLLibTestConfig |
| 6 | + TestConfig.Run |
41 | 7 | End Function
|
0 commit comments