Documentation ¶
Index ¶
- Constants
- func CheckResponseCode(t *testing.T, expected, actual int)
- func CreateTables(db database.Database)
- func DropAllTables(db database.Database)
- func ExecuteRequest(req *http.Request, app application.App) *httptest.ResponseRecorder
- func InsertGroups(db database.Database)
- func InsertRecords(db database.Database)
- func InsertUsers(db database.Database)
Constants ¶
View Source
const ( // CreateUserTable creates user table CreateUserTable = `CREATE TABLE MUser ( id SERIAL, w_name varchar(255) NOT NULL, w_id varchar(255) PRIMARY KEY );` // CreateGroupTable creates group table CreateGroupTable = `CREATE TABLE MGroup ( id SERIAL PRIMARY KEY, name varchar(255) NOT NULL, description text );` // CreateBelongToTable creates belong to table CreateBelongToTable = `` /* 282-byte string literal not displayed */ // CreateRecordTable creates record table CreateRecordTable = `` /* 429-byte string literal not displayed */ // CreateHistoryTable creates history table CreateHistoryTable = `` /* 311-byte string literal not displayed */ // DropUserTable drops user talbe DropUserTable = `DROP TABLE muser` // DropGroupTable drops group talbe DropGroupTable = `DROP TABLE mgroup` // DropBelongToTable drops belong to talbe DropBelongToTable = `DROP TABLE belongto` // DropRecordTable drops record talbe DropRecordTable = `DROP TABLE record` // DropHistoryTable drops history talbe DropHistoryTable = `DROP TABLE history` // RecordTableClear clears record table RecordTableClear = `DELETE FROM Record` // UserTableClear clears user table UserTableClear = `DELETE FROM MUser` // GroupTableClear clears group table GroupTableClear = `DELETE FROM MGroup` // InsertUserA inserts a sample user A InsertUserA = `INSERT INTO MUser (w_name, w_id) VALUES ('test user1', '12345u')` // InsertUserB inserts a sample user B InsertUserB = `INSERT INTO MUser (w_name, w_id) VALUES ('test user2', '23456u')` // InsertUserC inserts a sample user C InsertUserC = `INSERT INTO MUser (w_name, w_id) VALUES('test user3', '34567u')` // InsertGroupA inserts a sample group A InsertGroupA = `INSERT INTO MGroup (name, description) VALUES('292 Pasir Panjang Road', 'This is just a test group')` // InsertRecordOne inserts a sample record InsertRecordOne = `` /* 180-byte string literal not displayed */ // InsertRecordTwo inserts a sample record InsertRecordTwo = `` /* 180-byte string literal not displayed */ // InsertRecordThree inserts a sample record InsertRecordThree = `` /* 169-byte string literal not displayed */ // ResetUserSeq resets user sequence ResetUserSeq = `ALTER SEQUENCE muser_id_seq RESTART;` // ResetGroupSeq resets group sequence ResetGroupSeq = `ALTER SEQUENCE mgroup_id_seq RESTART;` // ResetRecordSeq resets group sequence ResetRecordSeq = `ALTER SEQUENCE record_id_seq RESTART;` )
Variables ¶
This section is empty.
Functions ¶
func CheckResponseCode ¶
CheckResponseCode checks response code equal
func CreateTables ¶
CreateTables creates all required tables
func DropAllTables ¶
DropAllTables Drops all tables in database
func ExecuteRequest ¶
func ExecuteRequest(req *http.Request, app application.App) *httptest.ResponseRecorder
ExecuteRequest executes a http request
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.