3 SQLites3Test
:= UnitTest
clone do(
7 self name
:= "myDatabase.sqlite3"
8 File clone setPath(name
) remove
9 self db
:= SQLite3
clone
16 test_2_create
:= method(
17 db
exec("CREATE TABLE Dbm (key, value)")
18 db
exec("CREATE INDEX DbmIndex ON Dbm (key)")
21 test_3_insert
:= method(
22 db
exec("INSERT INTO Dbm ('key', 'value') VALUES ('a', '123')")
23 db
exec("INSERT INTO Dbm ('key', 'value') VALUES ('a', 'efg')")
24 rows
:= db
exec("SELECT key, value FROM Dbm WHERE key='a'")
25 assertEquals(rows size
, 2)
28 test_3_delete
:= method(
29 db
exec("DELETE FROM Dbm WHERE key='a'")
30 rows
:= db
exec("SELECT key, value FROM Dbm WHERE key='a'")
31 assertEquals(rows size
, 0)
34 test_4_close
:= method(
36 assertFalse(db isOpen
)
37 File clone setPath(db path
) remove