|
| 1 | +VERSION 1.0 CLASS |
| 2 | +BEGIN |
| 3 | + MultiUse = -1 'True |
| 4 | +END |
| 5 | +Attribute VB_Name = "SQLlibUpdateTests" |
| 6 | +Attribute VB_GlobalNameSpace = False |
| 7 | +Attribute VB_Creatable = False |
| 8 | +Attribute VB_PredeclaredId = False |
| 9 | +Attribute VB_Exposed = False |
| 10 | +Implements iTestCase |
| 11 | +Sub iTestCase_Setup() |
| 12 | + |
| 13 | +End Sub |
| 14 | +Function iTestCase_GetAllTests() |
| 15 | + iTestCase_GetAllTests = Array("SimpleUpdateTest") |
| 16 | +End Function |
| 17 | + |
| 18 | +Function iTestCase_GetObject() |
| 19 | + Set iTestCase_GetObject = New SQLlibUpdateTests |
| 20 | +End Function |
| 21 | + |
| 22 | +Function SimpleUpdateTest() |
| 23 | + Dim MyUpdate As SQLUpdate |
| 24 | + Dim Interfaced As iSQLQuery |
| 25 | + Set MyUpdate = Create_SQLUpdate |
| 26 | + With MyUpdate |
| 27 | + .Table = "users" |
| 28 | + .Fields = Array("username") |
| 29 | + .Values = Array(str("admin' WHERE id=1;DROP TABLE users;")) |
| 30 | + .AddWhere "id", 1 |
| 31 | + End With |
| 32 | + Set Interfaced = MyUpdate |
| 33 | + SimpleUpdateTest = AssertObjectStringEquals(Interfaced, "UPDATE users SET username='admin'' WHERE id=1;DROP TABLE users;' WHERE id=1") |
| 34 | +End Function |
0 commit comments